@acronis-platform/ui-react 0.28.0 → 0.31.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acronis-platform/ui-react",
3
- "version": "0.28.0",
3
+ "version": "0.31.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/acronis/uikit.git",
@@ -46,9 +46,9 @@
46
46
  "clsx": "2.1.1",
47
47
  "react-resizable-panels": "4.11.2",
48
48
  "tailwind-merge": "3.6.0",
49
+ "@acronis-platform/design-assets": "0.4.0",
49
50
  "@acronis-platform/tokens-pd": "1.8.1",
50
- "@acronis-platform/icons-react": "0.4.0",
51
- "@acronis-platform/design-assets": "0.4.0"
51
+ "@acronis-platform/icons-react": "0.4.0"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@figma/code-connect": "1.4.8",
@@ -112,7 +112,11 @@
112
112
  "storybook:test:visual": "test-storybook",
113
113
  "storybook:test:visual:update": "test-storybook --updateSnapshot",
114
114
  "storybook:test:visual:docker": "pnpm storybook:build && docker compose -f ./docker-compose.storybook.yml up --build --abort-on-container-exit --exit-code-from test-runner",
115
+ "storybook:test:visual:docker:dark": "STORYBOOK_COLOR_MODE=dark pnpm storybook:test:visual:docker",
116
+ "storybook:test:visual:docker:all": "pnpm storybook:test:visual:docker && pnpm storybook:test:visual:docker:dark",
115
117
  "storybook:test:visual:docker:update": "pnpm storybook:build && docker compose -f ./docker-compose.storybook.yml -f ./docker-compose.storybook.update.yml up --build --abort-on-container-exit --exit-code-from test-runner",
118
+ "storybook:test:visual:docker:update:dark": "STORYBOOK_COLOR_MODE=dark pnpm storybook:test:visual:docker:update",
119
+ "storybook:test:visual:docker:update:all": "pnpm storybook:test:visual:docker:update && pnpm storybook:test:visual:docker:update:dark",
116
120
  "figma:connect": "figma connect parse",
117
121
  "figma:connect:publish": "figma connect publish",
118
122
  "figma:connect:unpublish": "figma connect unpublish"
@@ -1,105 +0,0 @@
1
- import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { Select as e } from "@base-ui/react/select";
4
- import { ChevronDownIcon as u, CheckIcon as p } from "@acronis-platform/icons-react/stroke-mono";
5
- import { cn as l } from "../../../lib/utils.js";
6
- const y = e.Root, I = e.Group, f = d.forwardRef(({ className: t, ...a }, o) => /* @__PURE__ */ r(
7
- e.Value,
8
- {
9
- ref: o,
10
- className: l(
11
- "min-w-0 flex-1 truncate text-left text-[var(--ui-form-text-value)] data-[placeholder]:text-[var(--ui-form-text-placeholder)]",
12
- // Disabled wins over the value/placeholder color regardless of variant order.
13
- "group-data-[disabled]:!text-[var(--ui-form-text-disabled)]",
14
- t
15
- ),
16
- ...a
17
- }
18
- ));
19
- f.displayName = "SelectValue";
20
- const b = d.forwardRef(({ className: t, children: a, ...o }, i) => /* @__PURE__ */ n(
21
- e.Trigger,
22
- {
23
- ref: i,
24
- className: l(
25
- "group flex h-8 w-full min-w-0 items-center gap-2 rounded border bg-[var(--ui-form-background-idle)] border-[var(--ui-form-border-idle)] px-3 text-sm leading-6 text-[var(--ui-form-text-value)] outline-none transition-colors",
26
- "not-data-[disabled]:hover:border-[var(--ui-form-border-hover)]",
27
- "focus-visible:border-[var(--ui-form-border-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]",
28
- "data-[popup-open]:border-[var(--ui-form-border-active)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]",
29
- "data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-form-border-disabled)] data-[disabled]:bg-[var(--ui-form-background-disabled)] data-[disabled]:text-[var(--ui-form-text-disabled)]",
30
- t
31
- ),
32
- ...o,
33
- children: [
34
- a,
35
- /* @__PURE__ */ r(e.Icon, { className: "flex shrink-0 items-center text-[var(--ui-form-icon-idle)] group-data-[disabled]:text-[var(--ui-form-icon-disabled)]", children: /* @__PURE__ */ r(
36
- u,
37
- {
38
- size: 16,
39
- className: "transition-transform group-data-[popup-open]:rotate-180"
40
- }
41
- ) })
42
- ]
43
- }
44
- ));
45
- b.displayName = "SelectTrigger";
46
- const x = d.forwardRef(({ className: t, children: a, sideOffset: o = 4, align: i = "start", side: s = "bottom", ...c }, m) => /* @__PURE__ */ r(e.Portal, { children: /* @__PURE__ */ r(
47
- e.Positioner,
48
- {
49
- sideOffset: o,
50
- align: i,
51
- side: s,
52
- alignItemWithTrigger: !1,
53
- className: "z-50 outline-none",
54
- children: /* @__PURE__ */ r(
55
- e.Popup,
56
- {
57
- ref: m,
58
- className: l(
59
- "max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded border border-border bg-background py-1 text-sm text-foreground shadow-md outline-none",
60
- t
61
- ),
62
- ...c,
63
- children: a
64
- }
65
- )
66
- }
67
- ) }));
68
- x.displayName = "SelectContent";
69
- const g = d.forwardRef(({ className: t, children: a, ...o }, i) => /* @__PURE__ */ n(
70
- e.Item,
71
- {
72
- ref: i,
73
- className: l(
74
- "relative flex cursor-default items-center gap-2 py-1.5 pr-8 pl-3 leading-6 outline-none select-none",
75
- "data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground",
76
- "data-[disabled]:pointer-events-none data-[disabled]:text-[var(--ui-form-text-disabled)]",
77
- t
78
- ),
79
- ...o,
80
- children: [
81
- /* @__PURE__ */ r(e.ItemText, { className: "min-w-0 flex-1 truncate", children: a }),
82
- /* @__PURE__ */ r(e.ItemIndicator, { className: "absolute right-2 flex items-center text-[var(--ui-form-icon-idle)]", children: /* @__PURE__ */ r(p, { size: 16 }) })
83
- ]
84
- }
85
- ));
86
- g.displayName = "SelectItem";
87
- const v = d.forwardRef(({ className: t, ...a }, o) => /* @__PURE__ */ r(
88
- e.GroupLabel,
89
- {
90
- ref: o,
91
- className: l("px-3 py-1.5 text-xs text-muted-foreground", t),
92
- ...a
93
- }
94
- ));
95
- v.displayName = "SelectGroupLabel";
96
- export {
97
- y as Select,
98
- x as SelectContent,
99
- I as SelectGroup,
100
- v as SelectGroupLabel,
101
- g as SelectItem,
102
- b as SelectTrigger,
103
- f as SelectValue
104
- };
105
- //# sourceMappingURL=select.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select.js","sources":["../../../../src/components/ui/select/select.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Select as SelectPrimitive } from '@base-ui/react/select';\nimport { CheckIcon, ChevronDownIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// STRANDED THEME: this component still binds to the legacy `--ui-form-*` token\n// tier, which is NOT shipped by @acronis-platform/tokens-pd. The Figma sync\n// (#308) added next-gen tiers for Radio (`--ui-radio-*`), Search\n// (`--ui-input-search-*`) and Input (`--ui-input-text-*`) but NOT for Select, so\n// there is nothing to rewire to yet — Select renders with unresolved colors until\n// a `--ui-select-*` tier ships. Re-theme it once those tokens land (tracked\n// alongside the token-drift guard, issue #297).\n//\n// A select: a Base UI `Select` themed with the shared `--ui-form-*` token tier\n// (the same tier Input/Search use). The trigger is the Figma \"Select\" box —\n// 32px tall, bordered, rounded — and wires each state to its own token:\n// idle / hover (`--ui-form-border-hover`) / open+focus (`--ui-form-border-active`\n// + a 3px `--ui-focus-primary` ring) / disabled. The chevron uses\n// `--ui-form-icon-idle` and rotates when the popup is open. The popup and items\n// aren't in the Figma spec, so they use the shared semantic surface vocabulary\n// (`bg-background`, `bg-accent`, `border-border`). Label, description, and error\n// message are composed by the consumer (a Field component is future work).\n\nconst Select = SelectPrimitive.Root;\n\nconst SelectGroup = SelectPrimitive.Group;\n\nconst SelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Value\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 truncate text-left text-[var(--ui-form-text-value)] data-[placeholder]:text-[var(--ui-form-text-placeholder)]',\n // Disabled wins over the value/placeholder color regardless of variant order.\n 'group-data-[disabled]:!text-[var(--ui-form-text-disabled)]',\n className\n )}\n {...props}\n />\n));\nSelectValue.displayName = 'SelectValue';\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={cn(\n 'group flex h-8 w-full min-w-0 items-center gap-2 rounded border bg-[var(--ui-form-background-idle)] border-[var(--ui-form-border-idle)] px-3 text-sm leading-6 text-[var(--ui-form-text-value)] outline-none transition-colors',\n 'not-data-[disabled]:hover:border-[var(--ui-form-border-hover)]',\n 'focus-visible:border-[var(--ui-form-border-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-[popup-open]:border-[var(--ui-form-border-active)] data-[popup-open]:ring-[3px] data-[popup-open]:ring-[var(--ui-focus-primary)]',\n 'data-[disabled]:cursor-not-allowed data-[disabled]:border-[var(--ui-form-border-disabled)] data-[disabled]:bg-[var(--ui-form-background-disabled)] data-[disabled]:text-[var(--ui-form-text-disabled)]',\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon className=\"flex shrink-0 items-center text-[var(--ui-form-icon-idle)] group-data-[disabled]:text-[var(--ui-form-icon-disabled)]\">\n <ChevronDownIcon\n size={16}\n className=\"transition-transform group-data-[popup-open]:rotate-180\"\n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = 'SelectTrigger';\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Popup> & {\n sideOffset?: number;\n align?: SelectPrimitive.Positioner.Props['align'];\n side?: SelectPrimitive.Positioner.Props['side'];\n }\n>(({ className, children, sideOffset = 4, align = 'start', side = 'bottom', ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n sideOffset={sideOffset}\n align={align}\n side={side}\n alignItemWithTrigger={false}\n className=\"z-50 outline-none\"\n >\n <SelectPrimitive.Popup\n ref={ref}\n className={cn(\n 'max-h-[var(--available-height)] min-w-[var(--anchor-width)] overflow-y-auto rounded border border-border bg-background py-1 text-sm text-foreground shadow-md outline-none',\n className\n )}\n {...props}\n >\n {children}\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = 'SelectContent';\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'relative flex cursor-default items-center gap-2 py-1.5 pr-8 pl-3 leading-6 outline-none select-none',\n 'data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground',\n 'data-[disabled]:pointer-events-none data-[disabled]:text-[var(--ui-form-text-disabled)]',\n className\n )}\n {...props}\n >\n <SelectPrimitive.ItemText className=\"min-w-0 flex-1 truncate\">\n {children}\n </SelectPrimitive.ItemText>\n <SelectPrimitive.ItemIndicator className=\"absolute right-2 flex items-center text-[var(--ui-form-icon-idle)]\">\n <CheckIcon size={16} />\n </SelectPrimitive.ItemIndicator>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = 'SelectItem';\n\nconst SelectGroupLabel = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.GroupLabel>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.GroupLabel>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.GroupLabel\n ref={ref}\n className={cn('px-3 py-1.5 text-xs text-muted-foreground', className)}\n {...props}\n />\n));\nSelectGroupLabel.displayName = 'SelectGroupLabel';\n\nexport {\n Select,\n SelectTrigger,\n SelectValue,\n SelectContent,\n SelectItem,\n SelectGroup,\n SelectGroupLabel,\n};\n"],"names":["Select","SelectPrimitive","SelectGroup","SelectValue","React","className","props","ref","jsx","cn","SelectTrigger","children","jsxs","ChevronDownIcon","SelectContent","sideOffset","align","side","SelectItem","CheckIcon","SelectGroupLabel"],"mappings":";;;;;AAwBA,MAAMA,IAASC,EAAgB,MAEzBC,IAAcD,EAAgB,OAE9BE,IAAcC,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACP,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAM;AAAA,IACA,WAAWE;AAAA,MACT;AAAA;AAAA,MAEA;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAY,cAAc;AAE1B,MAAMO,IAAgBN,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,GAAGL,KAASC,MACpC,gBAAAK;AAAA,EAACX,EAAgB;AAAA,EAAhB;AAAA,IACC,KAAAM;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,IAEH,UAAA;AAAA,MAAAK;AAAA,MACD,gBAAAH,EAACP,EAAgB,MAAhB,EAAqB,WAAU,wHAC9B,UAAA,gBAAAO;AAAA,QAACK;AAAA,QAAA;AAAA,UACC,MAAM;AAAA,UACN,WAAU;AAAA,QAAA;AAAA,MAAA,EACZ,CACF;AAAA,IAAA;AAAA,EAAA;AACF,CACD;AACDH,EAAc,cAAc;AAE5B,MAAMI,IAAgBV,EAAM,WAO1B,CAAC,EAAE,WAAAC,GAAW,UAAAM,GAAU,YAAAI,IAAa,GAAG,OAAAC,IAAQ,SAAS,MAAAC,IAAO,UAAU,GAAGX,EAAA,GAASC,MACtF,gBAAAC,EAACP,EAAgB,QAAhB,EACC,UAAA,gBAAAO;AAAA,EAACP,EAAgB;AAAA,EAAhB;AAAA,IACC,YAAAc;AA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