@lerianstudio/sindarian-ui 2.0.0-beta.1 → 2.0.0-beta.11
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/dist/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/components/breadcrumb/index.js +25 -1
- package/dist/components/card/account-card/index.js +5 -5
- package/dist/components/card/basic-card/index.d.ts.map +1 -1
- package/dist/components/card/basic-card/index.js +2 -2
- package/dist/components/card/entity-card/index.js +1 -1
- package/dist/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
- package/dist/components/dialog/confirmation-dialog/index.js +4 -1
- package/dist/components/entity-box/index.d.ts +18 -2
- package/dist/components/entity-box/index.d.ts.map +1 -1
- package/dist/components/entity-box/index.js +32 -4
- package/dist/components/form/file-upload-field/index.d.ts +11 -2
- package/dist/components/form/file-upload-field/index.d.ts.map +1 -1
- package/dist/components/form/file-upload-field/index.js +8 -3
- package/dist/components/form/input-field/index.d.ts +41 -2
- package/dist/components/form/input-field/index.d.ts.map +1 -1
- package/dist/components/form/input-field/index.js +73 -15
- package/dist/components/form/password-field/index.d.ts +5 -1
- package/dist/components/form/password-field/index.d.ts.map +1 -1
- package/dist/components/form/password-field/index.js +2 -2
- package/dist/components/form/select-field/index.d.ts +9 -1
- package/dist/components/form/select-field/index.d.ts.map +1 -1
- package/dist/components/form/select-field/index.js +2 -2
- package/dist/components/page-header/index.js +1 -1
- package/dist/components/table/id-table-cell.d.ts +5 -1
- package/dist/components/table/id-table-cell.d.ts.map +1 -1
- package/dist/components/table/id-table-cell.js +48 -6
- package/dist/components/ui/autocomplete/index.d.ts +24 -0
- package/dist/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/components/ui/autocomplete/index.js +24 -0
- package/dist/components/ui/badge/index.d.ts +11 -7
- package/dist/components/ui/badge/index.d.ts.map +1 -1
- package/dist/components/ui/badge/index.js +20 -8
- package/dist/components/ui/button/styles.css +31 -1
- package/dist/components/ui/calendar/index.d.ts.map +1 -1
- package/dist/components/ui/calendar/index.js +7 -1
- package/dist/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/components/ui/copy-field/index.js +1 -1
- package/dist/components/ui/file-upload/index.d.ts +235 -9
- package/dist/components/ui/file-upload/index.d.ts.map +1 -1
- package/dist/components/ui/file-upload/index.js +354 -17
- package/dist/components/ui/form.d.ts +4 -0
- package/dist/components/ui/form.d.ts.map +1 -1
- package/dist/components/ui/form.js +48 -6
- package/dist/components/ui/input/styles.css +75 -3
- package/dist/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/components/ui/sheet/index.js +2 -2
- package/dist/components/ui/sidebar/index.d.ts +1 -0
- package/dist/components/ui/sidebar/index.d.ts.map +1 -1
- package/dist/components/ui/sidebar/index.js +1 -0
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-expand-button.js +15 -1
- package/dist/components/ui/sidebar/sidebar-item.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-item.js +28 -4
- package/dist/components/ui/sidebar/sidebar-provider.d.ts +37 -0
- package/dist/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-provider.js +125 -4
- package/dist/components/ui/sidebar/sidebar-root.d.ts +38 -1
- package/dist/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
- package/dist/components/ui/sidebar/sidebar-root.js +100 -5
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
- package/dist/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
- package/dist/components/ui/sidebar/sidebar-trigger.js +30 -0
- package/dist/components/ui/toggle-group/index.d.ts +1 -1
- package/dist/components/ui/toggle-group/index.d.ts.map +1 -1
- package/dist/components/ui/toggle-group/index.js +73 -4
- package/dist/enterprise/number-input/index.d.ts.map +1 -1
- package/dist/enterprise/number-input/index.js +1 -1
- package/dist/esm/components/breadcrumb/index.d.ts.map +1 -1
- package/dist/esm/components/breadcrumb/index.js +25 -1
- package/dist/esm/components/card/account-card/index.js +5 -5
- package/dist/esm/components/card/basic-card/index.d.ts.map +1 -1
- package/dist/esm/components/card/basic-card/index.js +2 -2
- package/dist/esm/components/card/entity-card/index.js +1 -1
- package/dist/esm/components/dialog/confirmation-dialog/index.d.ts.map +1 -1
- package/dist/esm/components/dialog/confirmation-dialog/index.js +4 -1
- package/dist/esm/components/entity-box/index.d.ts +18 -2
- package/dist/esm/components/entity-box/index.d.ts.map +1 -1
- package/dist/esm/components/entity-box/index.js +29 -4
- package/dist/esm/components/form/file-upload-field/index.d.ts +11 -2
- package/dist/esm/components/form/file-upload-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/file-upload-field/index.js +8 -3
- package/dist/esm/components/form/input-field/index.d.ts +41 -2
- package/dist/esm/components/form/input-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/input-field/index.js +73 -15
- package/dist/esm/components/form/password-field/index.d.ts +5 -1
- package/dist/esm/components/form/password-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/password-field/index.js +2 -2
- package/dist/esm/components/form/select-field/index.d.ts +9 -1
- package/dist/esm/components/form/select-field/index.d.ts.map +1 -1
- package/dist/esm/components/form/select-field/index.js +2 -2
- package/dist/esm/components/page-header/index.js +1 -1
- package/dist/esm/components/table/id-table-cell.d.ts +5 -1
- package/dist/esm/components/table/id-table-cell.d.ts.map +1 -1
- package/dist/esm/components/table/id-table-cell.js +48 -3
- package/dist/esm/components/ui/autocomplete/index.d.ts +24 -0
- package/dist/esm/components/ui/autocomplete/index.d.ts.map +1 -1
- package/dist/esm/components/ui/autocomplete/index.js +24 -0
- package/dist/esm/components/ui/badge/index.d.ts +11 -7
- package/dist/esm/components/ui/badge/index.d.ts.map +1 -1
- package/dist/esm/components/ui/badge/index.js +20 -8
- package/dist/esm/components/ui/calendar/index.d.ts.map +1 -1
- package/dist/esm/components/ui/calendar/index.js +8 -2
- package/dist/esm/components/ui/copy-field/index.d.ts.map +1 -1
- package/dist/esm/components/ui/copy-field/index.js +1 -1
- package/dist/esm/components/ui/file-upload/index.d.ts +235 -9
- package/dist/esm/components/ui/file-upload/index.d.ts.map +1 -1
- package/dist/esm/components/ui/file-upload/index.js +353 -17
- package/dist/esm/components/ui/form.d.ts +4 -0
- package/dist/esm/components/ui/form.d.ts.map +1 -1
- package/dist/esm/components/ui/form.js +48 -6
- package/dist/esm/components/ui/sheet/index.d.ts.map +1 -1
- package/dist/esm/components/ui/sheet/index.js +2 -2
- package/dist/esm/components/ui/sidebar/index.d.ts +1 -0
- package/dist/esm/components/ui/sidebar/index.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/index.js +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-expand-button.js +15 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-item.js +28 -4
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts +37 -0
- package/dist/esm/components/ui/sidebar/sidebar-provider.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-provider.js +122 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts +38 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.d.ts.map +1 -1
- package/dist/esm/components/ui/sidebar/sidebar-root.js +102 -7
- package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts +18 -0
- package/dist/esm/components/ui/sidebar/sidebar-trigger.d.ts.map +1 -0
- package/dist/esm/components/ui/sidebar/sidebar-trigger.js +26 -0
- package/dist/esm/components/ui/toggle-group/index.d.ts +1 -1
- package/dist/esm/components/ui/toggle-group/index.d.ts.map +1 -1
- package/dist/esm/components/ui/toggle-group/index.js +73 -4
- package/dist/esm/enterprise/number-input/index.d.ts.map +1 -1
- package/dist/esm/enterprise/number-input/index.js +1 -1
- package/dist/globals.css +77 -31
- package/package.json +5 -3
|
@@ -210,5 +210,5 @@ export function NumberInput({ value, onValueChange, min, max, step = 1, precisio
|
|
|
210
210
|
};
|
|
211
211
|
const atMin = typeof min === 'number' && value !== null && value <= min;
|
|
212
212
|
const atMax = typeof max === 'number' && value !== null && value >= max;
|
|
213
|
-
return (_jsxs("div", { className: cn('inline-flex items-stretch gap-1', className), children: [_jsx(IconButton, { type: "button", variant: "outline", disabled: disabled || atMin, "aria-label": `Decrease${ariaLabel ? ` ${ariaLabel}` : ''}`, onClick: () => stepBy(-1), tabIndex: -1, children: _jsx(Minus, { className: "size-4", "aria-hidden": true }) }), _jsx("div", { className: "w-28", children: _jsx(Input, { id: id, inputMode: "decimal", role: "spinbutton", "aria-valuenow": value ?? undefined, "aria-valuemin": min, "aria-valuemax": max, className: "text-right tabular-nums", value: displayValue, placeholder: placeholder, disabled: disabled, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onChange: onChange, onKeyDown: onKeyDown, onFocus: onFocus, onBlur: onBlur }) }), _jsx(IconButton, { type: "button", variant: "outline", disabled: disabled || atMax, "aria-label": `Increase${ariaLabel ? ` ${ariaLabel}` : ''}`, onClick: () => stepBy(1), tabIndex: -1, children: _jsx(Plus, { className: "size-4", "aria-hidden": true }) })] }));
|
|
213
|
+
return (_jsxs("div", { className: cn('inline-flex items-stretch gap-1', className), children: [_jsx(IconButton, { className: "shrink-0", type: "button", variant: "outline", disabled: disabled || atMin, "aria-label": `Decrease${ariaLabel ? ` ${ariaLabel}` : ''}`, onClick: () => stepBy(-1), tabIndex: -1, children: _jsx(Minus, { className: "size-4", "aria-hidden": true }) }), _jsx("div", { className: "w-28 min-w-0", children: _jsx(Input, { id: id, inputMode: "decimal", role: "spinbutton", "aria-valuenow": value ?? undefined, "aria-valuemin": min, "aria-valuemax": max, className: "text-right tabular-nums", value: displayValue, placeholder: placeholder, disabled: disabled, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onChange: onChange, onKeyDown: onKeyDown, onFocus: onFocus, onBlur: onBlur }) }), _jsx(IconButton, { className: "shrink-0", type: "button", variant: "outline", disabled: disabled || atMax, "aria-label": `Increase${ariaLabel ? ` ${ariaLabel}` : ''}`, onClick: () => stepBy(1), tabIndex: -1, children: _jsx(Plus, { className: "size-4", "aria-hidden": true }) })] }));
|
|
214
214
|
}
|
package/dist/globals.css
CHANGED
|
@@ -214,6 +214,28 @@
|
|
|
214
214
|
:root {
|
|
215
215
|
color-scheme: light; /* native widgets (form controls, scrollbars) follow the theme */
|
|
216
216
|
|
|
217
|
+
/*
|
|
218
|
+
Sidebar geometry. These were literals inside SidebarRoot's cva
|
|
219
|
+
(`w-[244px]` / `w-[72px]`), which a consumer could only override by
|
|
220
|
+
winning a specificity argument with `cn`. As custom properties the
|
|
221
|
+
default still ships with this sheet.
|
|
222
|
+
|
|
223
|
+
TWO places to re-point them, and only these two:
|
|
224
|
+
- on the rail, via `className="[--sidebar-width:280px]"`. SidebarRoot
|
|
225
|
+
copies exactly these two arbitrary-property classes onto the mobile
|
|
226
|
+
drawer's own element, so one class moves the rail AND the drawer.
|
|
227
|
+
- on `:root` or `html`, which every layout inherits from.
|
|
228
|
+
|
|
229
|
+
NOT on a React-tree wrapper above the rail: that reaches the rail, but
|
|
230
|
+
the mobile drawer is portalled into document.body, and custom properties
|
|
231
|
+
inherit down the DOM tree. A wrapper is not an ancestor of the portal;
|
|
232
|
+
`:root` is.
|
|
233
|
+
|
|
234
|
+
They are theme-independent on purpose: a rail is not wider in the dark.
|
|
235
|
+
*/
|
|
236
|
+
--sidebar-width: 244px;
|
|
237
|
+
--sidebar-width-collapsed: 72px;
|
|
238
|
+
|
|
217
239
|
/* Application tokens (from Figma ring-tokens) */
|
|
218
240
|
--body-surface: 240 5% 96%; /* base/100 = #F4F4F5 */
|
|
219
241
|
/*
|
|
@@ -541,7 +563,7 @@
|
|
|
541
563
|
}
|
|
542
564
|
}
|
|
543
565
|
|
|
544
|
-
/* Sonner toast overrides —
|
|
566
|
+
/* Sonner toast overrides — tinted surfaces from the system token families */
|
|
545
567
|
[data-sonner-toaster] {
|
|
546
568
|
--width: 420px;
|
|
547
569
|
pointer-events: auto !important;
|
|
@@ -559,41 +581,41 @@
|
|
|
559
581
|
}
|
|
560
582
|
|
|
561
583
|
/*
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
584
|
+
Each coloured type paints the `surface` + `text` + `border` trio of its own
|
|
585
|
+
family — the pairing every other tinted component in the kit already uses
|
|
586
|
+
(`components/ui/badge/index.tsx`, `enterprise/alert-banner/index.tsx`).
|
|
587
|
+
`surface` is the only slot in a system family built to sit BEHIND content: it
|
|
588
|
+
darkens on the dark canvas, while `base` and `h1a` are fill and ink slots
|
|
589
|
+
that INVERT between themes (`--system-success-h1a` is #166534 in light and
|
|
590
|
+
#BBF7D0 in dark). Grounding toast text on either of those forces a different
|
|
591
|
+
ink per theme, and the toast stops tracking the family it names.
|
|
592
|
+
|
|
593
|
+
Ink over ground, light / dark: success 6.81 / 10.62, error 7.60 / 8.51,
|
|
594
|
+
warning 6.62 / 11.70 — every half clear of the 4.5 floor by more than two
|
|
595
|
+
points. `system text tokens` in `src/__tests__/tokens-contract.test.ts`
|
|
596
|
+
already measures this pair for all five families, so the toast is covered by
|
|
597
|
+
the gate that guards the pills rather than by a rule written for it alone;
|
|
598
|
+
`sonner toast ink` there reads whichever pair these rules declare.
|
|
599
|
+
|
|
600
|
+
`info` stays neutral on `--card`: an informational toast is the unstyled
|
|
601
|
+
case, not a fourth colour.
|
|
580
602
|
*/
|
|
581
603
|
[data-sonner-toast][data-type='success'] {
|
|
582
|
-
--normal-bg: hsl(var(--system-success));
|
|
583
|
-
--normal-text: hsl(var(--
|
|
584
|
-
--normal-border:
|
|
604
|
+
--normal-bg: hsl(var(--system-success-surface));
|
|
605
|
+
--normal-text: hsl(var(--system-success-text));
|
|
606
|
+
--normal-border: hsl(var(--system-success-border));
|
|
585
607
|
}
|
|
586
608
|
|
|
587
609
|
[data-sonner-toast][data-type='error'] {
|
|
588
|
-
--normal-bg: hsl(var(--system-error));
|
|
589
|
-
--normal-text: hsl(var(--
|
|
590
|
-
--normal-border:
|
|
610
|
+
--normal-bg: hsl(var(--system-error-surface));
|
|
611
|
+
--normal-text: hsl(var(--system-error-text));
|
|
612
|
+
--normal-border: hsl(var(--system-error-border));
|
|
591
613
|
}
|
|
592
614
|
|
|
593
615
|
[data-sonner-toast][data-type='warning'] {
|
|
594
|
-
--normal-bg: hsl(var(--system-alert));
|
|
595
|
-
--normal-text: hsl(var(--
|
|
596
|
-
--normal-border:
|
|
616
|
+
--normal-bg: hsl(var(--system-alert-surface));
|
|
617
|
+
--normal-text: hsl(var(--system-alert-text));
|
|
618
|
+
--normal-border: hsl(var(--system-alert-border));
|
|
597
619
|
}
|
|
598
620
|
|
|
599
621
|
[data-sonner-toast][data-type='info'] {
|
|
@@ -602,8 +624,32 @@
|
|
|
602
624
|
--normal-border: hsl(var(--border));
|
|
603
625
|
}
|
|
604
626
|
|
|
605
|
-
|
|
606
|
-
|
|
627
|
+
/*
|
|
628
|
+
The title outranks the description, and both rules have to WIN the cascade
|
|
629
|
+
for that to mean anything. Sonner ships
|
|
630
|
+
`[data-sonner-toast][data-styled='true'] [data-title]` at font-weight 500 and
|
|
631
|
+
its description twin at 400 — both (0,3,0), both injected at runtime.
|
|
632
|
+
The title rule here was a plain `[data-sonner-toast] [data-title]` (0,2,0):
|
|
633
|
+
it declared 600 and rendered at 500, losing outright, while the description
|
|
634
|
+
carried `!important` and rendered at 600. The hierarchy came out inverted on
|
|
635
|
+
every toast in the kit, the long line heavier than the label naming it.
|
|
636
|
+
|
|
637
|
+
Both now take the compound selector plus !important — the shape the
|
|
638
|
+
close-button rules below already use against this same stylesheet, and for
|
|
639
|
+
the same reason: source order cannot settle a tie with a sheet that is
|
|
640
|
+
injected at runtime.
|
|
641
|
+
|
|
642
|
+
The description returns to 400. It is the running text of a toast, and 14px
|
|
643
|
+
semibold across a full sentence reads as emphasis with nothing left to
|
|
644
|
+
emphasise; the family ink already carries the severity. Its `color` override
|
|
645
|
+
keeps !important on its own merits — sonner hardcodes #3f3f3f there, plus a
|
|
646
|
+
dark-theme rule of its own on top.
|
|
647
|
+
|
|
648
|
+
`toast text weights` in src/__tests__/tokens-contract.test.ts holds the order
|
|
649
|
+
and the two properties that let it apply.
|
|
650
|
+
*/
|
|
651
|
+
[data-sonner-toast][data-styled='true'] [data-title] {
|
|
652
|
+
font-weight: 600 !important;
|
|
607
653
|
font-size: 0.875rem;
|
|
608
654
|
line-height: 1.25rem;
|
|
609
655
|
}
|
|
@@ -611,7 +657,7 @@
|
|
|
611
657
|
[data-sonner-toast] [data-description],
|
|
612
658
|
[data-sonner-toast][data-styled='true'] [data-description] {
|
|
613
659
|
font-size: 0.875rem;
|
|
614
|
-
font-weight:
|
|
660
|
+
font-weight: 400 !important;
|
|
615
661
|
line-height: 1.25rem;
|
|
616
662
|
color: var(--normal-text) !important;
|
|
617
663
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lerianstudio/sindarian-ui",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.11",
|
|
4
4
|
"description": "Sindarian UI - A UI library for Midaz Console",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": {
|
|
@@ -43,12 +43,14 @@
|
|
|
43
43
|
"build:esm": "tsc -p tsconfig.esm.json && tsc-alias -p tsconfig.esm.json --resolve-full-paths && copyfiles -u 1 \"src/**/*.cjs\" \"src/**/*.d.cts\" \"src/**/*.json\" dist/esm && node -e \"require('fs').writeFileSync('dist/esm/package.json',JSON.stringify({type:'module'}))\" && node scripts/check-esm-output.mjs",
|
|
44
44
|
"copy:assets": "copyfiles -f src/public/**/* dist/public",
|
|
45
45
|
"copy:styles": "copyfiles -u 1 src/**/*.css dist",
|
|
46
|
-
"lint": "eslint .
|
|
46
|
+
"lint": "eslint .",
|
|
47
|
+
"lint:fix": "eslint . --fix",
|
|
47
48
|
"storybook": "storybook dev -p 6007",
|
|
48
49
|
"build-storybook": "storybook build",
|
|
49
50
|
"test": "jest",
|
|
50
51
|
"test:e2e": "exit 0",
|
|
51
|
-
"test:cov": "jest --coverage"
|
|
52
|
+
"test:cov": "jest --coverage",
|
|
53
|
+
"measure:input-shrink": "node scripts/measure-input-shrink.mjs"
|
|
52
54
|
},
|
|
53
55
|
"dependencies": {
|
|
54
56
|
"@radix-ui/react-accordion": "^1.2.20",
|