@acronis-platform/ui-react 0.50.0 → 0.53.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 (59) hide show
  1. package/dist/components/ui/accordion/accordion.js +53 -0
  2. package/dist/components/ui/accordion/accordion.js.map +1 -0
  3. package/dist/components/ui/app-shell/app-shell.js +75 -0
  4. package/dist/components/ui/app-shell/app-shell.js.map +1 -0
  5. package/dist/components/ui/auth-layout/auth-layout.js +56 -0
  6. package/dist/components/ui/auth-layout/auth-layout.js.map +1 -0
  7. package/dist/components/ui/collapsible/collapsible.js +22 -0
  8. package/dist/components/ui/collapsible/collapsible.js.map +1 -0
  9. package/dist/components/ui/grid/grid.js +69 -0
  10. package/dist/components/ui/grid/grid.js.map +1 -0
  11. package/dist/components/ui/number-field/number-field.js +61 -0
  12. package/dist/components/ui/number-field/number-field.js.map +1 -0
  13. package/dist/components/ui/page-content/page-content.js +19 -0
  14. package/dist/components/ui/page-content/page-content.js.map +1 -0
  15. package/dist/components/ui/page-header/page-header.js +74 -0
  16. package/dist/components/ui/page-header/page-header.js.map +1 -0
  17. package/dist/components/ui/pagination/pagination.js +87 -0
  18. package/dist/components/ui/pagination/pagination.js.map +1 -0
  19. package/dist/components/ui/section/section.js +37 -0
  20. package/dist/components/ui/section/section.js.map +1 -0
  21. package/dist/components/ui/slider/slider.js +42 -0
  22. package/dist/components/ui/slider/slider.js.map +1 -0
  23. package/dist/components/ui/stack/stack.js +61 -0
  24. package/dist/components/ui/stack/stack.js.map +1 -0
  25. package/dist/components/ui/toggle-group/toggle-group.js +47 -0
  26. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -0
  27. package/dist/index.js +354 -292
  28. package/dist/index.js.map +1 -1
  29. package/dist/react.js +354 -292
  30. package/dist/react.js.map +1 -1
  31. package/dist/src/components/ui/accordion/accordion.d.ts +7 -0
  32. package/dist/src/components/ui/accordion/index.d.ts +1 -0
  33. package/dist/src/components/ui/app-shell/app-shell.d.ts +8 -0
  34. package/dist/src/components/ui/app-shell/index.d.ts +1 -0
  35. package/dist/src/components/ui/auth-layout/auth-layout.d.ts +6 -0
  36. package/dist/src/components/ui/auth-layout/index.d.ts +1 -0
  37. package/dist/src/components/ui/collapsible/collapsible.d.ts +5 -0
  38. package/dist/src/components/ui/collapsible/index.d.ts +1 -0
  39. package/dist/src/components/ui/grid/grid.d.ts +15 -0
  40. package/dist/src/components/ui/grid/index.d.ts +1 -0
  41. package/dist/src/components/ui/number-field/index.d.ts +1 -0
  42. package/dist/src/components/ui/number-field/number-field.d.ts +7 -0
  43. package/dist/src/components/ui/page-content/index.d.ts +1 -0
  44. package/dist/src/components/ui/page-content/page-content.d.ts +4 -0
  45. package/dist/src/components/ui/page-header/index.d.ts +1 -0
  46. package/dist/src/components/ui/page-header/page-header.d.ts +8 -0
  47. package/dist/src/components/ui/pagination/index.d.ts +2 -0
  48. package/dist/src/components/ui/pagination/pagination.d.ts +25 -0
  49. package/dist/src/components/ui/section/index.d.ts +1 -0
  50. package/dist/src/components/ui/section/section.d.ts +7 -0
  51. package/dist/src/components/ui/slider/index.d.ts +1 -0
  52. package/dist/src/components/ui/slider/slider.d.ts +7 -0
  53. package/dist/src/components/ui/stack/index.d.ts +1 -0
  54. package/dist/src/components/ui/stack/stack.d.ts +13 -0
  55. package/dist/src/components/ui/toggle-group/index.d.ts +1 -0
  56. package/dist/src/components/ui/toggle-group/toggle-group.d.ts +7 -0
  57. package/dist/src/index.d.ts +13 -0
  58. package/dist/ui-react.css +1 -1
  59. package/package.json +3 -3
@@ -0,0 +1,37 @@
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import { cn as n } from "../../../lib/utils.js";
4
+ const s = i.forwardRef(
5
+ ({ className: e, ...t }, o) => /* @__PURE__ */ a("section", { ref: o, className: n("space-y-4", e), ...t })
6
+ );
7
+ s.displayName = "Section";
8
+ const c = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a("div", { ref: o, className: n("space-y-1", e), ...t }));
9
+ c.displayName = "SectionHeader";
10
+ const r = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
11
+ "h2",
12
+ {
13
+ ref: o,
14
+ className: n("text-lg font-semibold leading-none tracking-tight", e),
15
+ ...t
16
+ }
17
+ ));
18
+ r.displayName = "SectionTitle";
19
+ const m = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
20
+ "p",
21
+ {
22
+ ref: o,
23
+ className: n("text-sm text-muted-foreground", e),
24
+ ...t
25
+ }
26
+ ));
27
+ m.displayName = "SectionDescription";
28
+ const d = i.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a("div", { ref: o, className: n("pt-2", e), ...t }));
29
+ d.displayName = "SectionContent";
30
+ export {
31
+ s as Section,
32
+ d as SectionContent,
33
+ m as SectionDescription,
34
+ c as SectionHeader,
35
+ r as SectionTitle
36
+ };
37
+ //# sourceMappingURL=section.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"section.js","sources":["../../../../src/components/ui/section/section.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Ported 1:1 from `@acronis-platform`'s `section`. A titled content block —\n// semantic markup parts; the only color is the muted description\n// (`text-muted-foreground` → --ui-text-on-surface-secondary).\nconst Section = React.forwardRef<HTMLElement, React.HTMLAttributes<HTMLElement>>(\n ({ className, ...props }, ref) => (\n <section ref={ref} className={cn('space-y-4', className)} {...props} />\n )\n);\nSection.displayName = 'Section';\n\nconst SectionHeader = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('space-y-1', className)} {...props} />\n));\nSectionHeader.displayName = 'SectionHeader';\n\nconst SectionTitle = React.forwardRef<\n HTMLHeadingElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h2\n ref={ref}\n className={cn('text-lg font-semibold leading-none tracking-tight', className)}\n {...props}\n />\n));\nSectionTitle.displayName = 'SectionTitle';\n\nconst SectionDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <p\n ref={ref}\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n));\nSectionDescription.displayName = 'SectionDescription';\n\nconst SectionContent = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div ref={ref} className={cn('pt-2', className)} {...props} />\n));\nSectionContent.displayName = 'SectionContent';\n\nexport {\n Section,\n SectionHeader,\n SectionTitle,\n SectionDescription,\n SectionContent,\n};\n"],"names":["Section","React","className","props","ref","jsx","cn","SectionHeader","SectionTitle","SectionDescription","SectionContent"],"mappings":";;;AAOA,MAAMA,IAAUC,EAAM;AAAA,EACpB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MACxB,gBAAAC,EAAC,WAAA,EAAQ,KAAAD,GAAU,WAAWE,EAAG,aAAaJ,CAAS,GAAI,GAAGC,EAAA,CAAO;AAEzE;AACAH,EAAQ,cAAc;AAEtB,MAAMO,IAAgBN,EAAM,WAG1B,CAAC,EAAE,WAAAC,GAAW,GAAGC,KAASC,wBACzB,OAAA,EAAI,KAAAA,GAAU,WAAWE,EAAG,aAAaJ,CAAS,GAAI,GAAGC,GAAO,CAClE;AACDI,EAAc,cAAc;AAE5B,MAAMC,IAAeP,EAAM,WAGzB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,qDAAqDJ,CAAS;AAAA,IAC3E,GAAGC;AAAA,EAAA;AACN,CACD;AACDK,EAAa,cAAc;AAE3B,MAAMC,IAAqBR,EAAM,WAG/B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,KAAAD;AAAA,IACA,WAAWE,EAAG,iCAAiCJ,CAAS;AAAA,IACvD,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAmB,cAAc;AAEjC,MAAMC,IAAiBT,EAAM,WAG3B,CAAC,EAAE,WAAAC,GAAW,GAAGC,KAASC,wBACzB,OAAA,EAAI,KAAAA,GAAU,WAAWE,EAAG,QAAQJ,CAAS,GAAI,GAAGC,GAAO,CAC7D;AACDO,EAAe,cAAc;"}
@@ -0,0 +1,42 @@
1
+ import { jsx as o, jsxs as b } from "react/jsx-runtime";
2
+ import * as g from "react";
3
+ import { Slider as r } from "@base-ui/react/slider";
4
+ import { cn as s } from "../../../lib/utils.js";
5
+ const m = g.forwardRef(
6
+ ({ className: d, defaultValue: a, value: e, ...l }, t) => {
7
+ const n = e != null ? Array.isArray(e) ? e : [e] : void 0, i = a != null ? Array.isArray(a) ? a : [a] : [0], u = (n ?? i).length;
8
+ return /* @__PURE__ */ o(
9
+ r.Root,
10
+ {
11
+ ref: t,
12
+ value: n,
13
+ defaultValue: i,
14
+ className: s(
15
+ "group relative flex w-full touch-none select-none items-center",
16
+ d
17
+ ),
18
+ ...l,
19
+ children: /* @__PURE__ */ b(r.Control, { className: "relative flex w-full items-center py-2", children: [
20
+ /* @__PURE__ */ o(r.Track, { className: "relative h-1.5 w-full grow overflow-hidden rounded-full bg-[var(--ui-border-on-surface-border)]", children: /* @__PURE__ */ o(r.Indicator, { className: "rounded-full bg-[var(--ui-background-brand-secondary)] group-data-[disabled]:bg-[var(--ui-background-status-strong-neutral)]" }) }),
21
+ Array.from({ length: u }, (f, c) => /* @__PURE__ */ o(
22
+ r.Thumb,
23
+ {
24
+ className: s(
25
+ "block size-4 rounded-full border border-[var(--ui-background-brand-secondary)] bg-background shadow-sm transition-colors",
26
+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
27
+ "data-dragging:ring-2 data-dragging:ring-[var(--ui-focus-primary)]",
28
+ "data-disabled:pointer-events-none data-disabled:border-[var(--ui-background-status-strong-neutral)] data-disabled:opacity-50"
29
+ )
30
+ },
31
+ c
32
+ ))
33
+ ] })
34
+ }
35
+ );
36
+ }
37
+ );
38
+ m.displayName = "Slider";
39
+ export {
40
+ m as Slider
41
+ };
42
+ //# sourceMappingURL=slider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slider.js","sources":["../../../../src/components/ui/slider/slider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slider as SliderPrimitive } from '@base-ui/react/slider';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform`'s `slider`, on Base UI's Slider (Root / Control /\n// Track / Indicator / Thumb). Supports a single value or a range (array value) —\n// the thumb count follows the value/defaultValue length. No `--ui-slider-*` tier,\n// so it uses semantic tokens: the rail is the divider gray\n// (`--ui-border-on-surface-border`); the filled indicator and the thumb border use\n// the action blue (`--ui-background-brand-secondary`) — note legacy's `bg-primary`\n// is the dark navy in ui-react, so the action color is `secondary`.\nexport type SliderProps = React.ComponentPropsWithoutRef<\n typeof SliderPrimitive.Root\n>;\n\nconst Slider = React.forwardRef<HTMLDivElement, SliderProps>(\n ({ className, defaultValue, value, ...props }, ref) => {\n const normalizedValue =\n value != null ? (Array.isArray(value) ? value : [value]) : undefined;\n const normalizedDefaultValue =\n defaultValue != null\n ? Array.isArray(defaultValue)\n ? defaultValue\n : [defaultValue]\n : [0];\n const thumbCount = (normalizedValue ?? normalizedDefaultValue).length;\n\n return (\n <SliderPrimitive.Root\n ref={ref}\n value={normalizedValue}\n defaultValue={normalizedDefaultValue}\n className={cn(\n 'group relative flex w-full touch-none select-none items-center',\n className\n )}\n {...props}\n >\n <SliderPrimitive.Control className=\"relative flex w-full items-center py-2\">\n <SliderPrimitive.Track className=\"relative h-1.5 w-full grow overflow-hidden rounded-full bg-[var(--ui-border-on-surface-border)]\">\n <SliderPrimitive.Indicator className=\"rounded-full bg-[var(--ui-background-brand-secondary)] group-data-[disabled]:bg-[var(--ui-background-status-strong-neutral)]\" />\n </SliderPrimitive.Track>\n {Array.from({ length: thumbCount }, (_, i) => (\n <SliderPrimitive.Thumb\n key={i}\n className={cn(\n 'block size-4 rounded-full border border-[var(--ui-background-brand-secondary)] bg-background shadow-sm transition-colors',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-dragging:ring-2 data-dragging:ring-[var(--ui-focus-primary)]',\n 'data-disabled:pointer-events-none data-disabled:border-[var(--ui-background-status-strong-neutral)] data-disabled:opacity-50'\n )}\n />\n ))}\n </SliderPrimitive.Control>\n </SliderPrimitive.Root>\n );\n }\n);\nSlider.displayName = 'Slider';\n\nexport { Slider };\n"],"names":["Slider","React","className","defaultValue","value","props","ref","normalizedValue","normalizedDefaultValue","thumbCount","jsx","SliderPrimitive","cn","jsxs","_","i"],"mappings":";;;;AAkBA,MAAMA,IAASC,EAAM;AAAA,EACnB,CAAC,EAAE,WAAAC,GAAW,cAAAC,GAAc,OAAAC,GAAO,GAAGC,EAAA,GAASC,MAAQ;AACrD,UAAMC,IACJH,KAAS,OAAQ,MAAM,QAAQA,CAAK,IAAIA,IAAQ,CAACA,CAAK,IAAK,QACvDI,IACJL,KAAgB,OACZ,MAAM,QAAQA,CAAY,IACxBA,IACA,CAACA,CAAY,IACf,CAAC,CAAC,GACFM,KAAcF,KAAmBC,GAAwB;AAE/D,WACE,gBAAAE;AAAA,MAACC,EAAgB;AAAA,MAAhB;AAAA,QACC,KAAAL;AAAA,QACA,OAAOC;AAAA,QACP,cAAcC;AAAA,QACd,WAAWI;AAAA,UACT;AAAA,UACAV;AAAA,QAAA;AAAA,QAED,GAAGG;AAAA,QAEJ,UAAA,gBAAAQ,EAACF,EAAgB,SAAhB,EAAwB,WAAU,0CACjC,UAAA;AAAA,UAAA,gBAAAD,EAACC,EAAgB,OAAhB,EAAsB,WAAU,mGAC/B,UAAA,gBAAAD,EAACC,EAAgB,WAAhB,EAA0B,WAAU,+HAAA,CAA+H,EAAA,CACtK;AAAA,UACC,MAAM,KAAK,EAAE,QAAQF,KAAc,CAACK,GAAGC,MACtC,gBAAAL;AAAA,YAACC,EAAgB;AAAA,YAAhB;AAAA,cAEC,WAAWC;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,YACF;AAAA,YANKG;AAAA,UAAA,CAQR;AAAA,QAAA,EAAA,CACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AACAf,EAAO,cAAc;"}
@@ -0,0 +1,61 @@
1
+ import { jsx as f } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { cva as l } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
4
+ import { cn as p } from "../../../lib/utils.js";
5
+ const m = l("flex", {
6
+ variants: {
7
+ direction: {
8
+ vertical: "flex-col",
9
+ horizontal: "flex-row"
10
+ },
11
+ gap: {
12
+ none: "gap-0",
13
+ xs: "gap-1",
14
+ sm: "gap-2",
15
+ md: "gap-4",
16
+ lg: "gap-6",
17
+ xl: "gap-8"
18
+ },
19
+ align: {
20
+ start: "items-start",
21
+ center: "items-center",
22
+ end: "items-end",
23
+ stretch: "items-stretch"
24
+ },
25
+ justify: {
26
+ start: "justify-start",
27
+ center: "justify-center",
28
+ end: "justify-end",
29
+ between: "justify-between"
30
+ },
31
+ wrap: {
32
+ true: "flex-wrap",
33
+ false: "flex-nowrap"
34
+ }
35
+ },
36
+ defaultVariants: {
37
+ direction: "vertical",
38
+ gap: "md",
39
+ align: "stretch",
40
+ justify: "start",
41
+ wrap: !1
42
+ }
43
+ }), d = o.forwardRef(
44
+ ({ className: t, direction: e, gap: a, align: r, justify: s, wrap: i, ...n }, c) => /* @__PURE__ */ f(
45
+ "div",
46
+ {
47
+ ref: c,
48
+ className: p(
49
+ m({ direction: e, gap: a, align: r, justify: s, wrap: i }),
50
+ t
51
+ ),
52
+ ...n
53
+ }
54
+ )
55
+ );
56
+ d.displayName = "Stack";
57
+ export {
58
+ d as Stack,
59
+ m as stackVariants
60
+ };
61
+ //# sourceMappingURL=stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stack.js","sources":["../../../../src/components/ui/stack/stack.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Ported 1:1 from `@acronis-platform`'s `stack`. A flexbox layout primitive — no\n// color, just direction / gap / alignment utilities.\nconst stackVariants = cva('flex', {\n variants: {\n direction: {\n vertical: 'flex-col',\n horizontal: 'flex-row',\n },\n gap: {\n none: 'gap-0',\n xs: 'gap-1',\n sm: 'gap-2',\n md: 'gap-4',\n lg: 'gap-6',\n xl: 'gap-8',\n },\n align: {\n start: 'items-start',\n center: 'items-center',\n end: 'items-end',\n stretch: 'items-stretch',\n },\n justify: {\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n between: 'justify-between',\n },\n wrap: {\n true: 'flex-wrap',\n false: 'flex-nowrap',\n },\n },\n defaultVariants: {\n direction: 'vertical',\n gap: 'md',\n align: 'stretch',\n justify: 'start',\n wrap: false,\n },\n});\n\nexport interface StackProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof stackVariants> {}\n\nconst Stack = React.forwardRef<HTMLDivElement, StackProps>(\n ({ className, direction, gap, align, justify, wrap, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n stackVariants({ direction, gap, align, justify, wrap }),\n className\n )}\n {...props}\n />\n )\n);\nStack.displayName = 'Stack';\n\nexport { Stack, stackVariants };\n"],"names":["stackVariants","cva","Stack","React","className","direction","gap","align","justify","wrap","props","ref","jsx","cn"],"mappings":";;;;AAOA,MAAMA,IAAgBC,EAAI,QAAQ;AAAA,EAChC,UAAU;AAAA,IACR,WAAW;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,IAAA;AAAA,IAEd,KAAK;AAAA,MACH,MAAM;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA;AAAA,IAEN,OAAO;AAAA,MACL,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,IAEX,SAAS;AAAA,MACP,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,SAAS;AAAA,IAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,iBAAiB;AAAA,IACf,WAAW;AAAA,IACX,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,EAAA;AAEV,CAAC,GAMKC,IAAQC,EAAM;AAAA,EAClB,CAAC,EAAE,WAAAC,GAAW,WAAAC,GAAW,KAAAC,GAAK,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM,GAAGC,KAASC,MAC9D,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,WAAWE;AAAA,QACTb,EAAc,EAAE,WAAAK,GAAW,KAAAC,GAAK,OAAAC,GAAO,SAAAC,GAAS,MAAAC,GAAM;AAAA,QACtDL;AAAA,MAAA;AAAA,MAED,GAAGM;AAAA,IAAA;AAAA,EAAA;AAGV;AACAR,EAAM,cAAc;"}
@@ -0,0 +1,47 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { Toggle as i } from "@base-ui/react/toggle";
4
+ import { ToggleGroup as l } from "@base-ui/react/toggle-group";
5
+ import { cn as a } from "../../../lib/utils.js";
6
+ const n = a(
7
+ "inline-flex h-9 select-none items-center justify-center gap-2 rounded-md border border-transparent bg-transparent px-3 text-sm font-medium text-[var(--ui-text-on-surface-primary)] transition-colors outline-none",
8
+ "not-disabled:hover:bg-[var(--ui-background-surface-hover)]",
9
+ "focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]",
10
+ "data-pressed:bg-[var(--ui-background-surface-active)] data-pressed:text-[var(--ui-text-on-surface-primary)]",
11
+ "disabled:pointer-events-none disabled:opacity-50"
12
+ ), g = s.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
13
+ i,
14
+ {
15
+ ref: o,
16
+ className: a(n, e),
17
+ ...r
18
+ }
19
+ ));
20
+ g.displayName = "Toggle";
21
+ const m = s.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
22
+ l,
23
+ {
24
+ ref: o,
25
+ className: a(
26
+ "inline-flex items-center gap-1 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",
27
+ e
28
+ ),
29
+ ...r
30
+ }
31
+ ));
32
+ m.displayName = "ToggleGroup";
33
+ const c = s.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ */ t(
34
+ i,
35
+ {
36
+ ref: o,
37
+ className: a(n, e),
38
+ ...r
39
+ }
40
+ ));
41
+ c.displayName = "ToggleGroupItem";
42
+ export {
43
+ g as Toggle,
44
+ m as ToggleGroup,
45
+ c as ToggleGroupItem
46
+ };
47
+ //# sourceMappingURL=toggle-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-group.js","sources":["../../../../src/components/ui/toggle-group/toggle-group.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Toggle as TogglePrimitive } from '@base-ui/react/toggle';\nimport { ToggleGroup as ToggleGroupPrimitive } from '@base-ui/react/toggle-group';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform`'s `toggle-group`, on Base UI's Toggle /\n// ToggleGroup. No `--ui-toggle-*` tier — semantic tokens. The shared item style is\n// transparent when idle, the hover surface on hover, and the active surface +\n// foreground when pressed (legacy's `bg-muted` hover is near-white in ui-react, so\n// hover uses the visible surface-hover and the pressed state uses surface-active so\n// it reads as selected, distinct from hover).\nconst toggleItemClassName = cn(\n 'inline-flex h-9 select-none items-center justify-center gap-2 rounded-md border border-transparent bg-transparent px-3 text-sm font-medium text-[var(--ui-text-on-surface-primary)] transition-colors outline-none',\n 'not-disabled:hover:bg-[var(--ui-background-surface-hover)]',\n 'focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-primary)]',\n 'data-pressed:bg-[var(--ui-background-surface-active)] data-pressed:text-[var(--ui-text-on-surface-primary)]',\n 'disabled:pointer-events-none disabled:opacity-50'\n);\n\nconst Toggle = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive>\n>(({ className, ...props }, ref) => (\n <TogglePrimitive\n ref={ref}\n className={cn(toggleItemClassName, className)}\n {...props}\n />\n));\nToggle.displayName = 'Toggle';\n\nconst ToggleGroup = React.forwardRef<\n React.ComponentRef<typeof ToggleGroupPrimitive>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive>\n>(({ className, ...props }, ref) => (\n <ToggleGroupPrimitive\n ref={ref}\n className={cn(\n 'inline-flex items-center gap-1 data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch',\n className\n )}\n {...props}\n />\n));\nToggleGroup.displayName = 'ToggleGroup';\n\nconst ToggleGroupItem = React.forwardRef<\n HTMLButtonElement,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive>\n>(({ className, ...props }, ref) => (\n <TogglePrimitive\n ref={ref}\n className={cn(toggleItemClassName, className)}\n {...props}\n />\n));\nToggleGroupItem.displayName = 'ToggleGroupItem';\n\nexport { Toggle, ToggleGroup, ToggleGroupItem };\n"],"names":["toggleItemClassName","cn","Toggle","React","className","props","ref","jsx","TogglePrimitive","ToggleGroup","ToggleGroupPrimitive","ToggleGroupItem"],"mappings":";;;;;AAcA,MAAMA,IAAsBC;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEMC,IAASC,EAAM,WAGnB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWL,EAAGD,GAAqBI,CAAS;AAAA,IAC3C,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAO,cAAc;AAErB,MAAMO,IAAcN,EAAM,WAGxB,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACG;AAAAA,EAAA;AAAA,IACC,KAAAJ;AAAA,IACA,WAAWL;AAAA,MACT;AAAA,MACAG;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAY,cAAc;AAE1B,MAAME,IAAkBR,EAAM,WAG5B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC,KAAAF;AAAA,IACA,WAAWL,EAAGD,GAAqBI,CAAS;AAAA,IAC3C,GAAGC;AAAA,EAAA;AACN,CACD;AACDM,EAAgB,cAAc;"}