@techsio/ui-kit 0.45.0 → 0.47.0

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.
Files changed (46) hide show
  1. package/dist/atoms/hotkeys.js +52 -0
  2. package/dist/hotkeys.js +108 -0
  3. package/dist/internal/molecules/command.context.js +14 -0
  4. package/dist/molecules/command.js +177 -0
  5. package/dist/organisms/data-table.js +51 -46
  6. package/dist/src/atoms/hotkeys.d.ts +29 -0
  7. package/dist/src/atoms/hotkeys.d.ts.map +1 -0
  8. package/dist/src/hotkeys.d.ts +19 -0
  9. package/dist/src/hotkeys.d.ts.map +1 -0
  10. package/dist/src/internal/molecules/command.context.d.ts +6 -0
  11. package/dist/src/internal/molecules/command.context.d.ts.map +1 -0
  12. package/dist/src/molecules/command.d.ts +51 -0
  13. package/dist/src/molecules/command.d.ts.map +1 -0
  14. package/dist/src/molecules/toast.d.ts +9 -9
  15. package/dist/src/organisms/data-table.d.ts.map +1 -1
  16. package/dist/src/types/zag.d.ts +1 -0
  17. package/dist/src/types/zag.d.ts.map +1 -1
  18. package/dist/stories/atoms/hotkeys-hydration.fixture.d.ts +6 -0
  19. package/dist/stories/atoms/hotkeys-hydration.fixture.d.ts.map +1 -0
  20. package/dist/stories/atoms/hotkeys.stories.d.ts +336 -0
  21. package/dist/stories/atoms/hotkeys.stories.d.ts.map +1 -0
  22. package/dist/stories/changelog/changelog.stories.d.ts.map +1 -1
  23. package/dist/stories/molecules/command-hotkeys.stories.d.ts +38 -0
  24. package/dist/stories/molecules/command-hotkeys.stories.d.ts.map +1 -0
  25. package/dist/stories/molecules/command.stories.d.ts +74 -0
  26. package/dist/stories/molecules/command.stories.d.ts.map +1 -0
  27. package/dist/test/command-hotkeys.spec.d.ts +2 -0
  28. package/dist/test/command-hotkeys.spec.d.ts.map +1 -0
  29. package/dist/test/command.spec.d.ts +2 -0
  30. package/dist/test/command.spec.d.ts.map +1 -0
  31. package/dist/test/hotkeys.spec.d.ts +2 -0
  32. package/dist/test/hotkeys.spec.d.ts.map +1 -0
  33. package/package.json +6 -1
  34. package/src/tokens/components/atoms/_hotkeys.css +36 -0
  35. package/src/tokens/components/components.css +2 -0
  36. package/src/tokens/components/molecules/_command.css +43 -0
  37. package/src/tokens/components/organisms/_data-table.css +30 -7
  38. package/src/tokens/components/organisms/_table.css +0 -17
  39. package/src/tokens/figma/akros/variables.css +438 -0
  40. package/src/tokens/figma/brand-overrides.css +1 -1
  41. package/src/tokens/figma/business/variables.css +2 -2
  42. package/src/tokens/figma/dark/variables.css +39 -1
  43. package/src/tokens/figma/light/variables.css +431 -6
  44. package/src/tokens/figma/neo/variables.css +2 -2
  45. package/src/tokens/figma/neo-dark/variables.css +1 -1
  46. package/src/tokens/figma/variables.css +430 -5
@@ -0,0 +1,74 @@
1
+ import type { StoryObj } from "@storybook/react";
2
+ import { type Ref } from "react";
3
+ import { Command, type CommandItem } from "../../src/molecules/command.js";
4
+ declare const meta: {
5
+ title: string;
6
+ component: typeof Command;
7
+ tags: string[];
8
+ parameters: {
9
+ layout: string;
10
+ controls: {
11
+ disable: boolean;
12
+ };
13
+ };
14
+ decorators: ((Story: import("storybook/internal/csf").PartialStoryFn<import("storybook-react-rsbuild").ReactRenderer, {
15
+ disabled?: boolean | undefined | undefined;
16
+ onSelect?: ((details: import("@zag-js/combobox").SelectionDetails) => void) | undefined | undefined;
17
+ loopFocus?: boolean | undefined | undefined;
18
+ inputValue?: string | undefined | undefined;
19
+ defaultInputValue?: string | undefined | undefined;
20
+ onInputValueChange?: ((details: import("@zag-js/combobox").InputValueChangeDetails) => void) | undefined | undefined;
21
+ items: CommandItem[];
22
+ children: import("react").ReactNode;
23
+ id?: string | undefined;
24
+ className?: string | undefined;
25
+ ref?: Ref<HTMLDivElement> | undefined;
26
+ locale?: string | undefined;
27
+ onEscape?: (() => void) | undefined;
28
+ }>) => import("react/jsx-runtime").JSX.Element)[];
29
+ argTypes: {
30
+ disabled: {
31
+ control: "boolean";
32
+ };
33
+ loopFocus: {
34
+ control: "boolean";
35
+ };
36
+ locale: {
37
+ control: "text";
38
+ };
39
+ id: {
40
+ table: {
41
+ disable: true;
42
+ };
43
+ };
44
+ ref: {
45
+ table: {
46
+ disable: true;
47
+ };
48
+ };
49
+ children: {
50
+ table: {
51
+ disable: true;
52
+ };
53
+ };
54
+ };
55
+ args: {
56
+ items: CommandItem[];
57
+ disabled: false;
58
+ loopFocus: true;
59
+ onSelect: import("storybook/test").Mock<(...args: any[]) => any>;
60
+ children: null;
61
+ };
62
+ };
63
+ export default meta;
64
+ type Story = StoryObj<typeof meta>;
65
+ export declare const Playground: Story;
66
+ export declare const States: Story;
67
+ export declare const Grouped: Story;
68
+ export declare const DisabledItems: Story;
69
+ export declare const Localized: Story;
70
+ export declare const ChangingItems: Story;
71
+ export declare const InlineFocus: Story;
72
+ export declare const ControlledQuery: Story;
73
+ export declare const InDialog: Story;
74
+ //# sourceMappingURL=command.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.stories.d.ts","sourceRoot":"","sources":["../../../stories/molecules/command.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,EAAE,KAAK,GAAG,EAAoB,MAAM,OAAO,CAAA;AAIlD,OAAO,EACL,OAAO,EACP,KAAK,WAAW,EAEjB,MAAM,6BAA6B,CAAA;AAsHpC,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BsB,CAAA;AAEhC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,UAAU,EAAE,KAKxB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAYpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAS3B,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAevB,CAAA;AAiDD,eAAO,MAAM,aAAa,EAAE,KAG3B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KASzB,CAAA;AAmBD,eAAO,MAAM,eAAe,EAAE,KAG7B,CAAA;AAmCD,eAAO,MAAM,QAAQ,EAAE,KAAyD,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command-hotkeys.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-hotkeys.spec.d.ts","sourceRoot":"","sources":["../../test/command-hotkeys.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=command.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.spec.d.ts","sourceRoot":"","sources":["../../test/command.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=hotkeys.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hotkeys.spec.d.ts","sourceRoot":"","sources":["../../test/hotkeys.spec.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@techsio/ui-kit",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {
@@ -9,6 +9,10 @@
9
9
  "directory": "libs/ui"
10
10
  },
11
11
  "exports": {
12
+ "./hotkeys": {
13
+ "types": "./dist/src/hotkeys.d.ts",
14
+ "import": "./dist/hotkeys.js"
15
+ },
12
16
  "./types/zag": {
13
17
  "types": "./dist/src/types/zag.d.ts",
14
18
  "import": "./dist/types/zag.js"
@@ -111,6 +115,7 @@
111
115
  "@zag-js/dialog": "1.43.3",
112
116
  "@zag-js/drawer": "1.43.3",
113
117
  "@zag-js/file-upload": "1.43.3",
118
+ "@zag-js/hotkeys": "1.43.3",
114
119
  "@zag-js/i18n-utils": "1.43.3",
115
120
  "@zag-js/menu": "1.43.3",
116
121
  "@zag-js/number-input": "1.43.3",
@@ -0,0 +1,36 @@
1
+ @theme static {
2
+ /* BASE COLOR MAPPING */
3
+ --color-hotkeys-surface: var(--color-surface);
4
+ --color-hotkeys-text: var(--color-fg-secondary);
5
+ --color-hotkeys-outline: var(--color-border-primary);
6
+
7
+ /* DERIVED COLORS */
8
+ --color-hotkeys-key-bg: var(--color-hotkeys-surface);
9
+ --color-hotkeys-key-fg: var(--color-hotkeys-text);
10
+ --color-hotkeys-key-border: var(--color-hotkeys-outline);
11
+ --color-hotkeys-separator-fg: var(--color-hotkeys-text);
12
+
13
+ /* SPACING */
14
+ --gap-hotkeys: var(--spacing-50);
15
+ --padding-hotkeys-key-x: var(--spacing-100);
16
+ --padding-hotkeys-key-y: var(--spacing-50);
17
+
18
+ /* TYPOGRAPHY */
19
+ --text-hotkeys-sm: var(--text-xs);
20
+ --font-weight-hotkeys: var(--font-weight-medium);
21
+
22
+ /* BORDERS & RADIUS */
23
+ --border-width-hotkeys-key: var(--border-width-sm);
24
+ --radius-hotkeys-key: var(--radius-sm);
25
+ }
26
+
27
+ @utility hotkeys-key-border-width {
28
+ border-width: var(--border-width-hotkeys-key);
29
+ }
30
+
31
+ @utility hotkeys-target-focus {
32
+ outline-style: var(--default-ring-style);
33
+ outline-width: var(--default-ring-width);
34
+ outline-color: var(--color-primary);
35
+ outline-offset: var(--default-ring-offset);
36
+ }
@@ -5,6 +5,7 @@
5
5
  @import "./atoms/_button.css";
6
6
  @import "./atoms/_status-text.css";
7
7
  @import "./atoms/_checkbox.css";
8
+ @import "./atoms/_hotkeys.css";
8
9
  @import "./atoms/_icon.css";
9
10
  @import "./atoms/_image.css";
10
11
  @import "./atoms/_input.css";
@@ -23,6 +24,7 @@
23
24
  @import "./molecules/_chart.css";
24
25
  @import "./molecules/_color-select.css";
25
26
  @import "./molecules/_combobox.css";
27
+ @import "./molecules/_command.css";
26
28
  @import "./molecules/_date-picker.css";
27
29
  @import "./molecules/_dialog.css";
28
30
  @import "./molecules/_drawer.css";
@@ -0,0 +1,43 @@
1
+ @theme static {
2
+ /* BASE COLOR MAPPING */
3
+ --color-command-surface: var(--color-popup-bg);
4
+ --color-command-foreground: var(--color-popup-item-fg);
5
+ --color-command-muted: var(--color-popup-item-fg-muted);
6
+ --color-command-highlight: var(--color-popup-item-bg-hover);
7
+
8
+ /* DERIVED COLORS */
9
+ --color-command-bg: var(--color-command-surface);
10
+ --color-command-fg: var(--color-command-foreground);
11
+ --color-command-border: var(--color-popup-border);
12
+ --color-command-group-label-fg: var(--color-command-muted);
13
+ --color-command-empty-fg: var(--color-command-muted);
14
+
15
+ /* STATE VARIATIONS */
16
+ --color-command-item-bg-highlighted: var(--color-command-highlight);
17
+
18
+ /* DISABLED STATES */
19
+ --color-command-item-fg-disabled: var(--color-popup-item-fg-disabled);
20
+
21
+ /* SPACING */
22
+ --spacing-command-gap: var(--spacing-100);
23
+ --spacing-command-item-gap: var(--spacing-popup-item-md);
24
+ --spacing-command-list-max: var(--container-xs);
25
+ --padding-command: var(--spacing-150);
26
+ --padding-command-list: var(--padding-popup-viewport);
27
+ --padding-command-item-x: var(--padding-popup-item-x-md);
28
+ --padding-command-item-y: var(--padding-popup-item-y-md);
29
+ --padding-command-empty: var(--spacing-300);
30
+
31
+ /* TYPOGRAPHY */
32
+ --text-command-md: var(--text-sm);
33
+ --font-weight-command-group-label: var(--font-weight-medium);
34
+
35
+ /* BORDERS & RADIUS */
36
+ --border-width-command: var(--border-width-popup);
37
+ --radius-command: var(--radius-popup);
38
+ --radius-command-item: var(--radius-popup-item);
39
+ }
40
+
41
+ @utility command-border-width {
42
+ border-width: var(--border-width-command);
43
+ }
@@ -1,3 +1,26 @@
1
+ /*
2
+ * DataTable — component tokens.
3
+ *
4
+ * The colour, radius and spacing tokens all come from Figma via
5
+ * libs/ui/src/tokens/figma/variables.css (`--color-data-table-*`,
6
+ * `--padding-data-table-*`, `--spacing-data-table-*`).
7
+ *
8
+ * Kept here: the `-x`/`-y` padding composites. Figma exports padding split
9
+ * into halves, and Tailwind's `p-*` utilities resolve a single
10
+ * `--padding-<name>` value — there is no `px-<name>` lookup for a `-x` token.
11
+ * So the shorthands are rebuilt from the Figma halves (padding: y x), exactly
12
+ * as _table.css does for `--padding-table-cell-*`.
13
+ */
14
+
15
+ @theme static {
16
+ --padding-data-table-toolbar: var(--padding-data-table-toolbar-y)
17
+ var(--padding-data-table-toolbar-x);
18
+ --padding-data-table-filter-cell: var(--padding-data-table-filter-cell-y)
19
+ var(--padding-data-table-filter-cell-x);
20
+ --padding-data-table-pagination: var(--padding-data-table-pagination-y)
21
+ var(--padding-data-table-pagination-x);
22
+ }
23
+
1
24
  /*
2
25
  * DataTable — nested-row tint.
3
26
  *
@@ -5,10 +28,9 @@
5
28
  * than a background, so it composes with `striped`'s zebra background instead
6
29
  * of losing the Tailwind-merge conflict against it (two `bg-*` utilities on
7
30
  * one element can't both render; a shadow layers on top of whichever
8
- * background is already there). Reuses `--color-table-row-bg-hover`, an
9
- * existing Figma-exported Table token, rather than a raw semantic token or a
10
- * new one added ahead of the Figma sync this component's other colors are
11
- * still waiting on (see the "PROTOTYPE styling" note in data-table.tsx).
31
+ * background is already there). Reads `--color-data-table-row-bg-nested`,
32
+ * which aliases `--color-table-row-bg-hover` in Figma — the depth shading can
33
+ * now be retargeted without this file knowing which Table token backs it.
12
34
  */
13
35
  /*
14
36
  * Verified: box-shadow on a `<tr>` *does* paint under `border-collapse` in
@@ -21,7 +43,7 @@
21
43
  * would cause.
22
44
  */
23
45
  @utility data-table-row-nested-tint {
24
- box-shadow: inset 0 0 0 9999px var(--color-table-row-bg-hover);
46
+ box-shadow: inset 0 0 0 9999px var(--color-data-table-row-bg-nested);
25
47
  }
26
48
 
27
49
  /*
@@ -37,13 +59,14 @@
37
59
  * inheriting it yields a see-through cell.
38
60
  *
39
61
  * Compositing solves both at once — the same trick `OPAQUE_HEADER_BG` uses for
40
- * the header. The opaque table surface is the background-*color*; the row tint
62
+ * the header. The opaque surface is `--color-data-table-pinned-cell-bg` as the
63
+ * background-*color*; the row tint
41
64
  * is painted over it as a gradient image, read from a custom property the row
42
65
  * sets. Custom properties inherit, so the row can drive its cells' tint
43
66
  * without either knowing about the other.
44
67
  */
45
68
  @utility data-table-frozen-cell {
46
- background-color: var(--color-table-bg);
69
+ background-color: var(--color-data-table-pinned-cell-bg);
47
70
  background-image: linear-gradient(
48
71
  var(--dt-row-tint, transparent),
49
72
  var(--dt-row-tint, transparent)
@@ -14,21 +14,4 @@
14
14
  var(--padding-table-cell-md-x);
15
15
  --padding-table-cell-lg: var(--padding-table-cell-lg-y)
16
16
  var(--padding-table-cell-lg-x);
17
-
18
- /*
19
- * Foreground for a selected row. Figma exports
20
- * --color-table-row-bg-selected but has no `fg` counterpart, so
21
- * `text-table-row-fg-selected` in table.tsx generated no utility at all and
22
- * selected rows silently kept their normal text colour on the filled brand
23
- * background. Reported by review; this restores the intended pairing.
24
- *
25
- * White clears AA against every selected background the row can have:
26
- * base light #155dfc 5.24:1, base dark #0069a8 5.86:1, neo #e60101 4.81:1
27
- * in both modes. Mode-invariant, because the selected fill stays a solid
28
- * brand colour in light and dark alike.
29
- *
30
- * TEMPORARY BRIDGE: delete once Figma exports color/table/row/fg/selected —
31
- * figma/variables.css is imported after this file and would win.
32
- */
33
- --color-table-row-fg-selected: var(--color-white);
34
17
  }