@sapphire-caitlyn/schema-kit-ng 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -5
- package/package.json +3 -2
- package/styles/directives/border-shimmer.css +102 -0
- package/styles/directives/letter-reveal.css +21 -0
- package/styles.scss +14 -0
package/README.md
CHANGED
|
@@ -5,13 +5,35 @@ Lib de CRUD do backoffice: um `SchemaService` descreve a entidade, o `<schema-ta
|
|
|
5
5
|
|
|
6
6
|
## Entry points
|
|
7
7
|
|
|
8
|
-
| Import
|
|
9
|
-
|
|
|
10
|
-
| `@sapphire-caitlyn/schema-kit-ng`
|
|
11
|
-
| `@sapphire-caitlyn/schema-kit-ng/helm`
|
|
8
|
+
| Import | Conteúdo |
|
|
9
|
+
| --------------------------------------------- | ------------------------------------------------------------- |
|
|
10
|
+
| `@sapphire-caitlyn/schema-kit-ng` | A lib (`src/public-api.ts`) |
|
|
11
|
+
| `@sapphire-caitlyn/schema-kit-ng/helm` | Componentes Spartan (helm) embutidos na lib (`helm/index.ts`) |
|
|
12
|
+
| `@sapphire-caitlyn/schema-kit-ng/styles.scss` | Estilos globais da lib (`src/lib/styles.scss`), ver "Estilos" |
|
|
12
13
|
|
|
13
14
|
No `front-backoffice` a app não usa o pacote: importa o código-fonte pelos aliases do `tsconfig.json`
|
|
14
|
-
(`@schema-kit` e `@sapphire-caitlyn/schema-kit-ng/helm`), o que mantém o hot reload.
|
|
15
|
+
(`@schema-kit` e `@sapphire-caitlyn/schema-kit-ng/helm`), o que mantém o hot reload. Os estilos entram pelo
|
|
16
|
+
caminho do fonte no `src/styles.scss` (`@use '../projects/schema-kit/src/lib/styles'`).
|
|
17
|
+
|
|
18
|
+
## Estilos
|
|
19
|
+
|
|
20
|
+
O `src/lib/styles.scss` não é compilado no build da lib: o `ng-package.json` copia o `.scss` e o
|
|
21
|
+
`styles/directives/*.css` como estão para a raiz do pacote. Quem instala compila com o próprio Sass e Tailwind 4:
|
|
22
|
+
|
|
23
|
+
```scss
|
|
24
|
+
// styles.scss da app
|
|
25
|
+
@use '@sapphire-caitlyn/schema-kit-ng/styles.scss';
|
|
26
|
+
|
|
27
|
+
// O Tailwind não varre o node_modules: sem isso, as classes dos templates da lib não são geradas
|
|
28
|
+
@source '../node_modules/@sapphire-caitlyn/schema-kit-ng';
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
O arquivo traz o Tailwind (theme, preflight, utilities), as utilities `border-shimmer`/`letter-reveal` e ajustes
|
|
32
|
+
do select/combobox. As variáveis de tema (`--primary`, `--radius`...) e o preset do Spartan
|
|
33
|
+
(`@spartan-ng/brain/hlm-tailwind-preset.css`) ficam com a app.
|
|
34
|
+
|
|
35
|
+
Use o caminho com `.scss`: o `exports` do pacote só libera esse nome, então `.../styles` sem extensão não resolve.
|
|
36
|
+
Arquivo novo em `src/lib/styles/` sai no pacote só se for `.css` (ou se entrar nos `assets` do `ng-package.json`).
|
|
15
37
|
|
|
16
38
|
> **Não edite o `dist/schema-kit/package.json`.** A lib importa o helm por `<name>/helm`, e esse texto
|
|
17
39
|
> vai literal para o bundle. Renomear só no `dist` publica um pacote que importa o nome antigo
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire-caitlyn/schema-kit-ng",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/cdk": "^22.0.0",
|
|
6
6
|
"@angular/common": "^22.2.0",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"embla-carousel-angular": "^22.0.0",
|
|
21
21
|
"libphonenumber-js": "^1.13.14",
|
|
22
22
|
"luxon": "^3.7.2",
|
|
23
|
+
"ngx-scrollbar": "^19.1.5",
|
|
23
24
|
"rxjs": "^7.8.0",
|
|
24
25
|
"tailwindcss": "^4.1.12"
|
|
25
26
|
},
|
|
@@ -32,7 +33,7 @@
|
|
|
32
33
|
},
|
|
33
34
|
"sideEffects": false,
|
|
34
35
|
"exports": {
|
|
35
|
-
"./styles.
|
|
36
|
+
"./styles.scss": "./styles.scss",
|
|
36
37
|
"./package.json": {
|
|
37
38
|
"default": "./package.json"
|
|
38
39
|
},
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
|
|
2
|
+
/*
|
|
3
|
+
* border-shimmer — Tailwind CSS v4 utility
|
|
4
|
+
*
|
|
5
|
+
* A light glint that travels around an element's border.
|
|
6
|
+
* Works with any border-radius and any background (including transparent),
|
|
7
|
+
* because the ring is drawn on a masked pseudo-element.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* <div class="relative rounded-xl border-shimmer shimmer-sky-400">…</div>
|
|
11
|
+
*
|
|
12
|
+
* Requires a positioned element (relative / absolute / fixed / sticky).
|
|
13
|
+
*
|
|
14
|
+
* Modifiers (all optional):
|
|
15
|
+
* shimmer-{color} glint color (default: currentColor)
|
|
16
|
+
* shimmer-base-{color} resting ring color (default: 15% currentColor)
|
|
17
|
+
* ↳ both take an opacity modifier: shimmer-sky-400/60, shimmer-base-white/10
|
|
18
|
+
* shimmer-opacity-{n} whole-ring opacity (default: 100)
|
|
19
|
+
* shimmer-width-{px} ring thickness (default: 1px)
|
|
20
|
+
* shimmer-duration-{ms} one full lap (default: 3000ms)
|
|
21
|
+
* shimmer-spread-{deg} glint length (default: 60deg)
|
|
22
|
+
* All accept arbitrary values too, e.g. shimmer-[#f0f]/[35%], shimmer-width-[0.15rem].
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
@property --shimmer-angle {
|
|
26
|
+
syntax: "<angle>";
|
|
27
|
+
initial-value: 0deg;
|
|
28
|
+
inherits: false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes border-shimmer {
|
|
32
|
+
to {
|
|
33
|
+
--shimmer-angle: 360deg;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@utility border-shimmer {
|
|
38
|
+
&::after {
|
|
39
|
+
content: "";
|
|
40
|
+
position: absolute;
|
|
41
|
+
inset: 0;
|
|
42
|
+
z-index: var(--shimmer-z-index, 1);
|
|
43
|
+
border-radius: inherit;
|
|
44
|
+
padding: var(--shimmer-width, 1px);
|
|
45
|
+
pointer-events: none;
|
|
46
|
+
opacity: var(--shimmer-opacity, 100%);
|
|
47
|
+
|
|
48
|
+
background: conic-gradient(
|
|
49
|
+
from var(--shimmer-angle),
|
|
50
|
+
var(--shimmer-base, color-mix(in oklab, currentColor 15%, transparent)) 0deg,
|
|
51
|
+
var(--shimmer-color, currentColor) calc(var(--shimmer-spread, 60deg) * 0.5),
|
|
52
|
+
var(--shimmer-base, color-mix(in oklab, currentColor 15%, transparent)) var(--shimmer-spread, 60deg)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
/* Keep only the ring: full box minus the content box. */
|
|
56
|
+
mask:
|
|
57
|
+
linear-gradient(#000 0 0) content-box exclude,
|
|
58
|
+
linear-gradient(#000 0 0);
|
|
59
|
+
|
|
60
|
+
animation: border-shimmer var(--shimmer-duration, 3000ms) linear infinite;
|
|
61
|
+
|
|
62
|
+
@media (prefers-reduced-motion: reduce) {
|
|
63
|
+
animation: none;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@utility shimmer-* {
|
|
69
|
+
--shimmer-color: --value(--color-*, [color]);
|
|
70
|
+
--shimmer-color: color-mix(in oklab, --value(--color-*, [color]) calc(--modifier(integer) * 1%), transparent);
|
|
71
|
+
--shimmer-color: color-mix(in oklab, --value(--color-*, [color]) --modifier([percentage]), transparent);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@utility shimmer-base-* {
|
|
75
|
+
--shimmer-base: --value(--color-*, [color]);
|
|
76
|
+
--shimmer-base: color-mix(in oklab, --value(--color-*, [color]) calc(--modifier(integer) * 1%), transparent);
|
|
77
|
+
--shimmer-base: color-mix(in oklab, --value(--color-*, [color]) --modifier([percentage]), transparent);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@utility shimmer-opacity-* {
|
|
81
|
+
--shimmer-opacity: calc(--value(integer) * 1%);
|
|
82
|
+
--shimmer-opacity: --value([percentage], [number]);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@utility shimmer-width-* {
|
|
86
|
+
--shimmer-width: calc(--value(integer) * 1px);
|
|
87
|
+
--shimmer-width: --value([length]);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@utility shimmer-duration-* {
|
|
91
|
+
--shimmer-duration: calc(--value(integer) * 1ms);
|
|
92
|
+
--shimmer-duration: --value([*]);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@utility shimmer-spread-* {
|
|
96
|
+
--shimmer-spread: calc(--value(integer) * 1deg);
|
|
97
|
+
--shimmer-spread: --value([angle]);
|
|
98
|
+
}
|
|
99
|
+
@utility shimmer-z-index-* {
|
|
100
|
+
--shimmer-z-index: calc(--value(integer) * 1);
|
|
101
|
+
--shimmer-z-index: --value([*]);
|
|
102
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@utility letter-reveal {
|
|
2
|
+
display: inline-block;
|
|
3
|
+
animation: blur-reveal 500ms ease both;
|
|
4
|
+
animation-delay: calc((sibling-index() - 1) * 30ms);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
@theme {
|
|
8
|
+
@keyframes blur-reveal {
|
|
9
|
+
from {
|
|
10
|
+
opacity: 0;
|
|
11
|
+
filter: blur(12px);
|
|
12
|
+
transform: translateY(1rem);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
to {
|
|
16
|
+
opacity: 1;
|
|
17
|
+
filter: blur(0);
|
|
18
|
+
transform: translateY(0);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
package/styles.scss
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Sem a extensão: o Sass embute o .css aqui. Com `.css`, vira `@import` de CSS puro, resolvido a
|
|
2
|
+
// partir do `src/styles.scss` da app, e não acha o arquivo.
|
|
3
|
+
@use './styles/directives/border-shimmer';
|
|
4
|
+
@use './styles/directives/letter-reveal';
|
|
5
|
+
|
|
6
|
+
@layer theme, base, components, utilities;
|
|
7
|
+
@import 'tailwindcss/theme.css' layer(theme);
|
|
8
|
+
@import 'tailwindcss/preflight.css' layer(base);
|
|
9
|
+
@import 'tailwindcss/utilities.css';
|
|
10
|
+
|
|
11
|
+
hlm-select-trigger > [brnselecttrigger],
|
|
12
|
+
hlm-combobox-trigger > [brncomboboxtrigger] {
|
|
13
|
+
min-height: 2rem;
|
|
14
|
+
}
|