-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
853 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
...n/java/tech/jhipster/lite/generator/client/tikui/application/TikuiApplicationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package tech.jhipster.lite.generator.client.tikui.application; | ||
|
||
import org.springframework.stereotype.Service; | ||
import tech.jhipster.lite.generator.client.tikui.domain.TikuiModuleFactory; | ||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
@Service | ||
public class TikuiApplicationService { | ||
|
||
private final TikuiModuleFactory factory = new TikuiModuleFactory(); | ||
|
||
public JHipsterModule buildModule(JHipsterModuleProperties properties) { | ||
return factory.buildModule(properties); | ||
} | ||
} |
145 changes: 145 additions & 0 deletions
145
src/main/java/tech/jhipster/lite/generator/client/tikui/domain/TikuiModuleFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
package tech.jhipster.lite.generator.client.tikui.domain; | ||
|
||
import static tech.jhipster.lite.module.domain.JHipsterModule.*; | ||
import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.*; | ||
|
||
import tech.jhipster.lite.module.domain.JHipsterModule; | ||
import tech.jhipster.lite.module.domain.file.JHipsterDestination; | ||
import tech.jhipster.lite.module.domain.file.JHipsterSource; | ||
import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties; | ||
|
||
public class TikuiModuleFactory { | ||
|
||
private static final JHipsterSource SOURCE = from("client/tikui"); | ||
private static final JHipsterSource STYLE_SOURCE = SOURCE.append("style"); | ||
|
||
private static final JHipsterDestination STYLE_DESTINATION = to("src/main/style"); | ||
|
||
private static final String ATOM = "atom"; | ||
private static final String ATOM_BUTTON = ATOM + "/button"; | ||
private static final String ATOM_INPUT_TEXT = ATOM + "/input-text"; | ||
private static final String ATOM_LABEL = ATOM + "/label"; | ||
private static final String MOLECULE = "molecule"; | ||
private static final String MOLECULE_FIELD = MOLECULE + "/field"; | ||
private static final String ORGANISM = "organism"; | ||
private static final String ORGANISM_LINES = ORGANISM + "/lines"; | ||
private static final String QUARK = "quark"; | ||
|
||
//@formatter:off | ||
public JHipsterModule buildModule(JHipsterModuleProperties properties) { | ||
return moduleBuilder(properties) | ||
.packageJson() | ||
.addDependency(packageName("@tikui/core"), COMMON) | ||
.addDevDependency(packageName("stylelint"), COMMON) | ||
.addDevDependency(packageName("stylelint-config-concentric-order"), COMMON) | ||
.addDevDependency(packageName("stylelint-config-standard-scss"), COMMON) | ||
.addDevDependency(packageName("stylelint-order"), COMMON) | ||
.addDevDependency(packageName("tikuidoc-tikui"), COMMON) | ||
.addScript(scriptKey("build:tikui"), scriptCommand("tikui-core build")) | ||
.addScript(scriptKey("dev:tikui"), scriptCommand("tikui-core serve")) | ||
.and() | ||
.files() | ||
.add(SOURCE.template("tikuiconfig.json"), to("tikuiconfig.json")) | ||
.add(SOURCE.template(".stylelintrc.json"), to(".stylelintrc.json")) | ||
.batch(STYLE_SOURCE, STYLE_DESTINATION) | ||
.addTemplate("tikui.scss") | ||
.addTemplate("favicon.ico") | ||
.addTemplate("index.pug") | ||
.addTemplate("layout.pug") | ||
.addTemplate("layout-documentation.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ATOM), STYLE_DESTINATION.append(ATOM)) | ||
.addTemplate("_atom.scss") | ||
.addTemplate("atom.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ATOM_BUTTON), STYLE_DESTINATION.append(ATOM_BUTTON)) | ||
.addTemplate("_button.scss") | ||
.addTemplate("button.code.pug") | ||
.addTemplate("button.md") | ||
.addTemplate("button.mixin.pug") | ||
.addTemplate("button.render.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ATOM_INPUT_TEXT), STYLE_DESTINATION.append(ATOM_INPUT_TEXT)) | ||
.addTemplate("_input-text.scss") | ||
.addTemplate("input-text.code.pug") | ||
.addTemplate("input-text.md") | ||
.addTemplate("input-text.mixin.pug") | ||
.addTemplate("input-text.render.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ATOM_LABEL), STYLE_DESTINATION.append(ATOM_LABEL)) | ||
.addTemplate("_label.scss") | ||
.addTemplate("label.code.pug") | ||
.addTemplate("label.md") | ||
.addTemplate("label.mixin.pug") | ||
.addTemplate("label.render.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(MOLECULE), STYLE_DESTINATION.append(MOLECULE)) | ||
.addTemplate("_molecule.scss") | ||
.addTemplate("molecule.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(MOLECULE_FIELD), STYLE_DESTINATION.append(MOLECULE_FIELD)) | ||
.addTemplate("_field.scss") | ||
.addTemplate("field.code.pug") | ||
.addTemplate("field.md") | ||
.addTemplate("field.mixin.pug") | ||
.addTemplate("field.render.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ORGANISM), STYLE_DESTINATION.append(ORGANISM)) | ||
.addTemplate("_organism.scss") | ||
.addTemplate("organism.pug") | ||
.and() | ||
.batch(STYLE_SOURCE.append(QUARK), STYLE_DESTINATION.append(QUARK)) | ||
.addTemplate("_placeholder.scss") | ||
.addTemplate("_spacing.scss") | ||
.and() | ||
.batch(STYLE_SOURCE.append(ORGANISM_LINES), STYLE_DESTINATION.append(ORGANISM_LINES)) | ||
.addTemplate("_lines.scss") | ||
.addTemplate("lines.code.pug") | ||
.addTemplate("lines.md") | ||
.addTemplate("lines.mixin.pug") | ||
.addTemplate("lines.render.pug") | ||
.and() | ||
.add(STYLE_SOURCE.template("template/template.pug"), STYLE_DESTINATION.append("template/template.pug")) | ||
.batch(STYLE_SOURCE.append("token"), STYLE_DESTINATION.append("token")) | ||
.addTemplate("spacing/_spacings.scss") | ||
.addTemplate("spacing/_vars.scss") | ||
.addTemplate("_animations.scss") | ||
.addTemplate("_color.scss") | ||
.addTemplate("_font.scss") | ||
.addTemplate("_gradient.scss") | ||
.addTemplate("_radius.scss") | ||
.addTemplate("_size.scss") | ||
.addTemplate("_token.scss") | ||
.and() | ||
.and() | ||
.optionalReplacements() | ||
.in(path("vite.config.ts")) | ||
.add(lineAfterRegex("port:\\s*9000,"), vueStyleProxy(properties)) | ||
.and() | ||
.in(path("src/main/webapp/index.html")) | ||
.add(lineBeforeText("</head>"), tikuiLink(properties)) | ||
.and() | ||
.and() | ||
.gitIgnore() | ||
.pattern(".tikui-cache") | ||
.and() | ||
.build(); | ||
//@formatter:on | ||
} | ||
|
||
private String tikuiLink(JHipsterModuleProperties properties) { | ||
return properties.indentation().times(2) + "<link rel=\"stylesheet\" href=\"/style/tikui.css\" />"; | ||
} | ||
|
||
private static String vueStyleProxy(JHipsterModuleProperties properties) { | ||
return """ | ||
{S}{S}proxy: { | ||
{S}{S}{S}'/style': { | ||
{S}{S}{S}{S}ws: true, | ||
{S}{S}{S}{S}changeOrigin: true, | ||
{S}{S}{S}{S}rewrite: path => path.replace('/style', ''), | ||
{S}{S}{S}{S}target: 'http://localhost:9005', | ||
{S}{S}{S}}, | ||
{S}{S}},""".replace("{S}", properties.indentation().times(1)); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
...jhipster/lite/generator/client/tikui/infrastructure/primary/TikuiModuleConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package tech.jhipster.lite.generator.client.tikui.infrastructure.primary; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import tech.jhipster.lite.generator.client.tikui.application.TikuiApplicationService; | ||
import tech.jhipster.lite.generator.slug.domain.JHLiteFeatureSlug; | ||
import tech.jhipster.lite.generator.slug.domain.JHLiteModuleSlug; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization; | ||
import tech.jhipster.lite.module.domain.resource.JHipsterModuleResource; | ||
|
||
@Configuration | ||
class TikuiModuleConfiguration { | ||
|
||
@Bean | ||
JHipsterModuleResource tikuiModule(TikuiApplicationService tikui) { | ||
return JHipsterModuleResource.builder() | ||
.slug(JHLiteModuleSlug.TIKUI) | ||
.withoutProperties() | ||
.apiDoc("Frontend", "Add Tikui, a pattern library to build your styles") | ||
.organization(JHipsterModuleOrganization.builder().addDependency(JHLiteFeatureSlug.CLIENT_CORE).build()) | ||
.tags("client", "frontend", "tikui") | ||
.factory(tikui::buildModule); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/main/java/tech/jhipster/lite/generator/client/tikui/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@tech.jhipster.lite.BusinessContext | ||
package tech.jhipster.lite.generator.client.tikui; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/resources/generator/client/tikui/.stylelintrc.json.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ | ||
"plugins": ["stylelint-scss", "stylelint-order"], | ||
"extends": ["stylelint-config-standard-scss", "stylelint-config-concentric-order"], | ||
"rules": { | ||
"max-nesting-depth": 3, | ||
"selector-class-pattern": "^-?([a-z][a-z0-9]*)(-[a-z0-9]+)*$", | ||
"no-descending-specificity": null, | ||
"selector-no-qualifying-type": [ | ||
true, | ||
{ | ||
"ignore": ["class"] | ||
} | ||
], | ||
"order/order": [ | ||
{ | ||
"type": "at-rule", | ||
"name": "import" | ||
}, | ||
"dollar-variables", | ||
"custom-properties", | ||
{ | ||
"type": "at-rule", | ||
"name": "extend" | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "mixin" | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "add-mixin" | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "apply" | ||
}, | ||
"declarations", | ||
{ | ||
"type": "rule", | ||
"selector": "/^&:[\\w-]+/", | ||
"hasBlock": true | ||
}, | ||
{ | ||
"type": "rule", | ||
"selector": "/^&:[\\w-]+/", | ||
"hasBlock": true | ||
}, | ||
"rules", | ||
{ | ||
"type": "at-rule", | ||
"name": "include", | ||
"parameter": "/breakpoints?/i", | ||
"hasBlock": true | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "mixin", | ||
"parameter": "/breakpoints?/i", | ||
"hasBlock": true | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "add-mixin", | ||
"parameter": "/breakpoints?/i", | ||
"hasBlock": true | ||
}, | ||
{ | ||
"type": "at-rule", | ||
"name": "media", | ||
"hasBlock": true | ||
} | ||
] | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/generator/client/tikui/style/atom/_atom.scss.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@use 'button/button'; | ||
@use 'input-text/input-text'; | ||
@use 'label/label'; |
20 changes: 20 additions & 0 deletions
20
src/main/resources/generator/client/tikui/style/atom/atom.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
extends /layout-documentation | ||
|
||
block append vars | ||
-active='atom' | ||
|
||
block title | ||
title Tikui - Atoms | ||
|
||
block content | ||
.tikui-vertical-spacing.-s32 | ||
.tikui-vertical-spacing--line | ||
h1.tikui-title-main#atoms Atoms | ||
.tikui-vertical-spacing--line | ||
include /documentation/atomic-design/quote/atom | ||
.tikui-vertical-spacing--line | ||
include:componentDoc(height=80) button/button.md | ||
.tikui-vertical-spacing--line | ||
include:componentDoc(height=180) input-text/input-text.md | ||
.tikui-vertical-spacing--line | ||
include:componentDoc(height=70) label/label.md |
32 changes: 32 additions & 0 deletions
32
src/main/resources/generator/client/tikui/style/atom/button/_button.scss.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@use '../../quark/placeholder'; | ||
|
||
.button { | ||
--button-background: var(--color-primary); | ||
box-sizing: border-box; | ||
border: 1px solid var(--button-background); | ||
border-radius: var(--radius-field); | ||
background-color: var(--button-background); | ||
cursor: pointer; | ||
padding: var(--spacing-v-field) var(--spacing-h-field); | ||
min-height: var(--height-field); | ||
vertical-align: middle; | ||
line-height: 1.25rem; | ||
color: var(--color-text-on-primary); | ||
font-size: 1rem; | ||
&:hover { | ||
--button-background: var(--color-primary-lighter); | ||
} | ||
|
||
&:disabled { | ||
--button-background: var(--color-disabled); | ||
cursor: not-allowed; | ||
} | ||
|
||
@include placeholder.placeholder-alternative { | ||
cursor: default; | ||
min-width: 6rem; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/generator/client/tikui/style/atom/button/button.code.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include button.mixin.pug | ||
|
||
+button Button | ||
+button Button #[br] multiple lines | ||
+button({disabled: true}) Disabled | ||
+button({placeholder: true}) |
1 change: 1 addition & 0 deletions
1
src/main/resources/generator/client/tikui/style/atom/button/button.md.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
## Button |
5 changes: 5 additions & 0 deletions
5
src/main/resources/generator/client/tikui/style/atom/button/button.mixin.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mixin button(options) | ||
-const { disabled, type, placeholder } = options || {}; | ||
-const placeholderClass = placeholder ? '-placeholder' : null; | ||
button.button(disabled=disabled type=type class=placeholderClass) | ||
block |
4 changes: 4 additions & 0 deletions
4
src/main/resources/generator/client/tikui/style/atom/button/button.render.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
extends /layout | ||
|
||
block body | ||
include button.code.pug |
25 changes: 25 additions & 0 deletions
25
src/main/resources/generator/client/tikui/style/atom/input-text/_input-text.scss.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@use '../../quark/placeholder'; | ||
|
||
.input-text { | ||
--input-text-border-color: var(--color-border-field); | ||
box-sizing: border-box; | ||
outline: none; | ||
border: 1px solid var(--input-text-border-color); | ||
border-radius: var(--radius-field); | ||
background-color: var(--color-background); | ||
padding: var(--spacing-v-field) var(--spacing-h-field); | ||
width: 100%; | ||
height: var(--height-field); | ||
color: var(--color-text); | ||
font-size: 1rem; | ||
&:focus { | ||
--input-text-border-color: var(--color-primary); | ||
} | ||
|
||
@include placeholder.placeholder-alternative { | ||
cursor: default; | ||
pointer-events: none; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/generator/client/tikui/style/atom/input-text/input-text.code.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include input-text.mixin.pug | ||
|
||
+input-text | ||
+input-text({placeholder: 'Placeholder'}) | ||
+input-text({value: 'Value', placeholder: 'Placeholder'}) | ||
+input-text({placeholderLoading: true}) |
1 change: 1 addition & 0 deletions
1
src/main/resources/generator/client/tikui/style/atom/input-text/input-text.md.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
## Input text |
4 changes: 4 additions & 0 deletions
4
...main/resources/generator/client/tikui/style/atom/input-text/input-text.mixin.pug.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
mixin input-text(options) | ||
-const {id, placeholder, value, placeholderLoading} = options || {}; | ||
-const placeholderClass = placeholderLoading ? '-placeholder' : null; | ||
input.input-text(id=id type='text' placeholder=placeholder class=placeholderClass) |
Oops, something went wrong.