@dataworkz/crystal 0.1.0-beta.1 → 0.1.0-beta.3
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/CHANGELOG.md +35 -0
- package/fesm2022/dataworkz-crystal-icons.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal-primeng.mjs +20 -1
- package/fesm2022/dataworkz-crystal-primeng.mjs.map +1 -1
- package/fesm2022/dataworkz-crystal.mjs +927 -27
- package/fesm2022/dataworkz-crystal.mjs.map +1 -1
- package/icons/index.d.ts +3 -1
- package/index.d.ts +411 -12
- package/package.json +4 -7
- package/primeng/index.d.ts +30 -1
- package/styles/components/button.css +3 -0
- package/styles/components/content.css +5 -0
- package/styles/components/form.css +34 -3
- package/styles/crystal-no-fonts.css +2 -0
package/primeng/index.d.ts
CHANGED
|
@@ -610,6 +610,35 @@ declare const DwPreset: _primeuix_themes_types.Preset<_primeuix_themes_aura_base
|
|
|
610
610
|
|
|
611
611
|
/** PrimeNG's dark mode follows the attribute ThemeService (and provideCrystal()) put on <html>. */
|
|
612
612
|
declare const DW_DARK_MODE_SELECTOR = "[data-theme=\"dark\"]";
|
|
613
|
+
/** Panel class that sizes a select's option list for a small trigger (components/form.css). */
|
|
614
|
+
declare const DW_SELECT_PANEL_SM = "dw-select-panel--sm";
|
|
615
|
+
type SizedInstance = {
|
|
616
|
+
size?: () => string | null | undefined;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Crystal's pass-through defaults: a small `p-select` / `p-multiselect` gets small options even when its list is
|
|
620
|
+
* appended to <body> (where CSS can't see the trigger).
|
|
621
|
+
*/
|
|
622
|
+
declare const DW_PRIMENG_PT: {
|
|
623
|
+
readonly select: {
|
|
624
|
+
readonly overlay: ({ instance }: {
|
|
625
|
+
instance?: SizedInstance;
|
|
626
|
+
}) => {
|
|
627
|
+
class: string;
|
|
628
|
+
} | {
|
|
629
|
+
class?: undefined;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
readonly multiselect: {
|
|
633
|
+
readonly overlay: ({ instance }: {
|
|
634
|
+
instance?: SizedInstance;
|
|
635
|
+
}) => {
|
|
636
|
+
class: string;
|
|
637
|
+
} | {
|
|
638
|
+
class?: undefined;
|
|
639
|
+
};
|
|
640
|
+
};
|
|
641
|
+
};
|
|
613
642
|
/**
|
|
614
643
|
* PrimeNG with the Dataworkz preset, dark mode on `[data-theme="dark"]`. Pass app-specific PrimeNG settings
|
|
615
644
|
* (ripple, zIndex, translation…) as `config`; its `theme.options` are merged over crystal's.
|
|
@@ -620,4 +649,4 @@ declare const DW_DARK_MODE_SELECTOR = "[data-theme=\"dark\"]";
|
|
|
620
649
|
*/
|
|
621
650
|
declare function provideCrystalPrimeNG(config?: PrimeNGConfigType): EnvironmentProviders;
|
|
622
651
|
|
|
623
|
-
export { AZURE_PRIMARY_RAMP, DW_COLOR_SCHEME, DW_DARK_MODE_SELECTOR, DW_PRESET_OVERRIDES, DwPreset, provideCrystalPrimeNG };
|
|
652
|
+
export { AZURE_PRIMARY_RAMP, DW_COLOR_SCHEME, DW_DARK_MODE_SELECTOR, DW_PRESET_OVERRIDES, DW_PRIMENG_PT, DW_SELECT_PANEL_SM, DwPreset, provideCrystalPrimeNG };
|
|
@@ -325,6 +325,9 @@
|
|
|
325
325
|
.dw-icon-btn.is-active { background: var(--dw-accent-tint); color: var(--dw-accent); }
|
|
326
326
|
/* Hovering the active (selected) button keeps it accented, a step stronger */
|
|
327
327
|
.dw-icon-btn.is-active:hover:not(:disabled) { background: var(--dw-accent-tint-strong); color: var(--dw-accent); }
|
|
328
|
+
/* A selected danger toggle (e.g. a "not helpful" rating) keeps its danger colour instead of the accent. */
|
|
329
|
+
.dw-icon-btn--danger.is-active,
|
|
330
|
+
.dw-icon-btn--danger.is-active:hover:not(:disabled) { background: var(--dw-danger-tint); color: var(--dw-danger-solid); }
|
|
328
331
|
.dw-icon-btn--inverse { color: var(--dw-text-muted); }
|
|
329
332
|
.dw-icon-btn--inverse:hover:not(:disabled),
|
|
330
333
|
.dw-icon-btn--inverse.is-active { background: color-mix(in srgb, var(--dw-text-inverse) 12%, transparent); color: var(--dw-text-inverse); }
|
|
@@ -156,3 +156,8 @@ dw-markdown.dw-prose { display: block; }
|
|
|
156
156
|
/* ── dw-icon: app SVG glyphs, drawn in currentColor at the text size ── */
|
|
157
157
|
.dw-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; line-height: 0; vertical-align: -0.125em; }
|
|
158
158
|
.dw-icon svg { display: block; }
|
|
159
|
+
/* A PrimeIcons glyph (dw-icon pi="…") is a font glyph: it needs a line box, which the SVG case sets to 0. */
|
|
160
|
+
.dw-icon.pi { line-height: 1; }
|
|
161
|
+
.dw-icon--spin { animation: dw-icon-spin 1s linear infinite; }
|
|
162
|
+
@keyframes dw-icon-spin { to { transform: rotate(360deg); } }
|
|
163
|
+
@media (prefers-reduced-motion: reduce) { .dw-icon--spin, .dw-icon.pi-spin { animation-duration: 3s; } }
|
|
@@ -225,7 +225,7 @@ dw-field.dw-field--inline:has(.dw-field__control :is(.p-inputtext-sm, .p-textare
|
|
|
225
225
|
.dw-field__control > :first-child:not([dwFieldSuffix]) { flex: 1 1 auto; min-width: 0; }
|
|
226
226
|
/* Switches, checkboxes and radios keep their own size — stretching one turns a toggle into a bar. */
|
|
227
227
|
/* (Same specificity as the stretch rule above, plus the element, so it wins.) */
|
|
228
|
-
.dw-field__control > :is(p-toggleswitch, p-checkbox, p-radiobutton):first-child:not([dwFieldSuffix]) { flex: none; }
|
|
228
|
+
.dw-field__control > :is(p-toggleswitch, p-checkbox, p-radiobutton, dw-switch, dw-checkbox, dw-radio):first-child:not([dwFieldSuffix]) { flex: none; }
|
|
229
229
|
.dw-field__control > input,
|
|
230
230
|
.dw-field__control > textarea,
|
|
231
231
|
.dw-field__control > p-select,
|
|
@@ -470,8 +470,9 @@ p-slider {
|
|
|
470
470
|
|
|
471
471
|
|
|
472
472
|
/* Small selects (size="small"): their option list matches the 12px trigger instead of the default
|
|
473
|
-
14px rows.
|
|
474
|
-
|
|
473
|
+
14px rows. A list rendered inside the select matches `.p-select-sm`; a list appended elsewhere
|
|
474
|
+
(appendTo="body") gets `dw-select-panel--sm` from provideCrystalPrimeNG()'s pass-through, so no
|
|
475
|
+
screen sets it by hand. */
|
|
475
476
|
.p-select-sm .p-select-option,
|
|
476
477
|
.p-multiselect-sm .p-multiselect-option,
|
|
477
478
|
.dw-select-panel--sm .p-select-option,
|
|
@@ -675,3 +676,33 @@ body .dw-var-field .p-textarea {
|
|
|
675
676
|
.config-form-body .toggle-label { margin: 0; cursor: pointer; }
|
|
676
677
|
/* Host of a config form component inside .config-drawer-body: fill the drawer height. */
|
|
677
678
|
.config-form-host { display: flex; flex: 1; flex-direction: column; min-height: 0; }
|
|
679
|
+
|
|
680
|
+
/* ── dw-select / dw-multiselect (components) ──
|
|
681
|
+
The host takes the screen's sizing (a width, `dw-w-full`, a grid track) and the PrimeNG control fills it; with no
|
|
682
|
+
width set, the host is as wide as the control would be on its own. */
|
|
683
|
+
.dw-select,
|
|
684
|
+
.dw-multiselect {
|
|
685
|
+
display: inline-flex;
|
|
686
|
+
min-width: 0;
|
|
687
|
+
max-width: 100%;
|
|
688
|
+
vertical-align: middle;
|
|
689
|
+
}
|
|
690
|
+
.dw-select > p-select,
|
|
691
|
+
.dw-multiselect > p-multiselect {
|
|
692
|
+
flex: 1 1 auto;
|
|
693
|
+
min-width: 0;
|
|
694
|
+
}
|
|
695
|
+
.dw-select.dw-select--fluid,
|
|
696
|
+
.dw-multiselect.dw-multiselect--fluid {
|
|
697
|
+
display: flex;
|
|
698
|
+
width: 100%;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/* ── dw-checkbox / dw-radio / dw-switch (components): the control and its label on one line (dw-check) ── */
|
|
702
|
+
.dw-checkbox__label--empty:empty,
|
|
703
|
+
.dw-radio__label--empty:empty { display: none; }
|
|
704
|
+
|
|
705
|
+
/* ── dw-number-input (component): sized by the screen like dw-select ── */
|
|
706
|
+
.dw-number-input { display: inline-flex; min-width: 0; max-width: 100%; vertical-align: middle; }
|
|
707
|
+
.dw-number-input > p-inputnumber { flex: 1 1 auto; min-width: 0; }
|
|
708
|
+
.dw-number-input.dw-number-input--fluid { display: flex; width: 100%; }
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Rules: colours only in tokens/primitives.css (everything else uses semantic tokens); font-family only in base.css.
|
|
6
6
|
*/
|
|
7
|
+
/* PrimeIcons (pi pi-*): crystal's dependency, so an app never installs or loads it itself. Its font is local. */
|
|
8
|
+
@import 'primeicons/primeicons.css';
|
|
7
9
|
@import './tokens/primitives.css';
|
|
8
10
|
@import './tokens/semantic.css';
|
|
9
11
|
@import './tokens/semantic-dark.css';
|