@frontify/fondue-components 1.2.3 → 1.3.1

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 (58) hide show
  1. package/dist/fondue-components.js +18 -4
  2. package/dist/fondue-components.js.map +1 -1
  3. package/dist/fondue-components10.js +46 -117
  4. package/dist/fondue-components10.js.map +1 -1
  5. package/dist/fondue-components11.js +47 -32
  6. package/dist/fondue-components11.js.map +1 -1
  7. package/dist/fondue-components12.js +45 -2359
  8. package/dist/fondue-components12.js.map +1 -1
  9. package/dist/fondue-components13.js +8 -143
  10. package/dist/fondue-components13.js.map +1 -1
  11. package/dist/fondue-components14.js +12 -29
  12. package/dist/fondue-components14.js.map +1 -1
  13. package/dist/fondue-components15.js +157 -0
  14. package/dist/fondue-components15.js.map +1 -0
  15. package/dist/fondue-components16.js +121 -0
  16. package/dist/fondue-components16.js.map +1 -0
  17. package/dist/fondue-components17.js +121 -0
  18. package/dist/fondue-components17.js.map +1 -0
  19. package/dist/fondue-components18.js +23 -0
  20. package/dist/fondue-components18.js.map +1 -0
  21. package/dist/fondue-components19.js +33 -0
  22. package/dist/fondue-components19.js.map +1 -0
  23. package/dist/fondue-components20.js +63 -0
  24. package/dist/fondue-components20.js.map +1 -0
  25. package/dist/fondue-components21.js +20 -0
  26. package/dist/fondue-components21.js.map +1 -0
  27. package/dist/fondue-components22.js +38 -0
  28. package/dist/fondue-components22.js.map +1 -0
  29. package/dist/fondue-components23.js +28 -0
  30. package/dist/fondue-components23.js.map +1 -0
  31. package/dist/fondue-components24.js +11 -0
  32. package/dist/fondue-components24.js.map +1 -0
  33. package/dist/fondue-components25.js +8 -0
  34. package/dist/fondue-components25.js.map +1 -0
  35. package/dist/fondue-components26.js +18 -0
  36. package/dist/fondue-components26.js.map +1 -0
  37. package/dist/fondue-components27.js +2363 -0
  38. package/dist/fondue-components27.js.map +1 -0
  39. package/dist/fondue-components28.js +146 -0
  40. package/dist/fondue-components28.js.map +1 -0
  41. package/dist/fondue-components29.js +32 -0
  42. package/dist/fondue-components29.js.map +1 -0
  43. package/dist/fondue-components3.js +5 -5
  44. package/dist/fondue-components4.js +44 -51
  45. package/dist/fondue-components4.js.map +1 -1
  46. package/dist/fondue-components5.js +63 -32
  47. package/dist/fondue-components5.js.map +1 -1
  48. package/dist/fondue-components6.js +23 -8
  49. package/dist/fondue-components6.js.map +1 -1
  50. package/dist/fondue-components7.js +57 -11
  51. package/dist/fondue-components7.js.map +1 -1
  52. package/dist/fondue-components8.js +23 -153
  53. package/dist/fondue-components8.js.map +1 -1
  54. package/dist/fondue-components9.js +38 -117
  55. package/dist/fondue-components9.js.map +1 -1
  56. package/dist/index.d.ts +468 -8
  57. package/dist/style.css +1 -1
  58. package/package.json +41 -31
@@ -1,10 +1,24 @@
1
1
  import "./fondue-components2.js";
2
2
  import { Button as e } from "./fondue-components3.js";
3
- import { Divider as m } from "./fondue-components4.js";
4
- import { LoadingBar as f } from "./fondue-components5.js";
3
+ import { Checkbox as m } from "./fondue-components4.js";
4
+ import { Dialog as f } from "./fondue-components5.js";
5
+ import { Divider as l } from "./fondue-components6.js";
6
+ import { Flyout as a } from "./fondue-components7.js";
7
+ import { Label as g } from "./fondue-components8.js";
8
+ import { LoadingBar as b } from "./fondue-components9.js";
9
+ import { SegmentedControl as C } from "./fondue-components10.js";
10
+ import { TextInput as L } from "./fondue-components11.js";
11
+ import { Tooltip as c } from "./fondue-components12.js";
5
12
  export {
6
13
  e as Button,
7
- m as Divider,
8
- f as LoadingBar
14
+ m as Checkbox,
15
+ f as Dialog,
16
+ l as Divider,
17
+ a as Flyout,
18
+ g as Label,
19
+ b as LoadingBar,
20
+ C as SegmentedControl,
21
+ L as TextInput,
22
+ c as Tooltip
9
23
  };
10
24
  //# sourceMappingURL=fondue-components.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"fondue-components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -1,121 +1,50 @@
1
- import { sv as t } from "./fondue-components7.js";
2
- const s = t({
3
- variants: {
4
- emphasis: {
5
- default: "",
6
- weak: "",
7
- strong: ""
8
- },
9
- style: {
10
- default: "",
11
- positive: "",
12
- negative: "",
13
- danger: "",
14
- loud: ""
15
- },
16
- disabled: {
17
- true: "tw-text-box-disabled-inverse"
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import * as r from "@radix-ui/react-toggle-group";
3
+ import { forwardRef as m } from "react";
4
+ import { useControllableState as S } from "./fondue-components23.js";
5
+ import { segmentedControlRootStyles as f, segmentedControlActiveIndicatorStyles as I, segmentedControlItemStyles as y, segmentedControlItemSeparatorStyles as N, segmentedControlItemLabelStyles as u, segmentedControlItemLabelActiveStyles as b, segmentedControlItemLabelInactiveStyles as h } from "./fondue-components24.js";
6
+ const d = ({ children: e, value: o, defaultValue: s, onValueChange: c, ...a }, g) => {
7
+ const [p, C] = S({
8
+ prop: o,
9
+ defaultProp: s,
10
+ onChange: c
11
+ });
12
+ return /* @__PURE__ */ l(
13
+ r.Root,
14
+ {
15
+ ref: g,
16
+ ...a,
17
+ className: f,
18
+ onValueChange: (n) => {
19
+ n && C(n);
20
+ },
21
+ value: p,
22
+ type: "single",
23
+ asChild: !1,
24
+ "aria-disabled": a.disabled,
25
+ children: [
26
+ e,
27
+ /* @__PURE__ */ t("div", { className: I })
28
+ ]
18
29
  }
19
- },
20
- compoundVariants: [
21
- {
22
- disabled: !1,
23
- style: "default",
24
- emphasis: "default",
25
- class: "tw-text-button-text group-hover:tw-text-button-text-hover group-active:tw-text-button-text-pressed"
26
- },
27
- {
28
- disabled: !1,
29
- style: "default",
30
- emphasis: "weak",
31
- class: "tw-text-button-text group-hover:tw-text-button-text-hover group-active:tw-text-button-text-pressed"
32
- },
33
- {
34
- disabled: !1,
35
- style: "default",
36
- emphasis: "strong",
37
- class: "tw-text-button-strong-icon group-hover:tw-text-button-strong-icon-hover group-active:tw-text-button-strong-text-pressed"
38
- },
39
- {
40
- disabled: !1,
41
- style: "positive",
42
- emphasis: "default",
43
- class: "tw-text-button-positive-text group-hover:tw-text-button-positive-text-hover group-active:tw-text-button-positive-text-pressed"
44
- },
45
- {
46
- disabled: !1,
47
- style: "positive",
48
- emphasis: "weak",
49
- class: "tw-text-button-positive-text group-hover:tw-text-button-positive-text-hover group-active:tw-text-button-positive-text-pressed"
50
- },
51
- {
52
- disabled: !1,
53
- style: "positive",
54
- emphasis: "strong",
55
- class: "tw-text-button-strong-positive-text group-hover:tw-text-button-strong-positive-text-hover group-active:tw-text-button-strong-positive-text-pressed"
56
- },
57
- {
58
- disabled: !1,
59
- style: "negative",
60
- emphasis: "default",
61
- class: "tw-text-button-negative-text group-hover:tw-text-button-negative-text-hovergroup-active:tw-text-button-negative-text-pressed"
62
- },
63
- {
64
- disabled: !1,
65
- style: "negative",
66
- emphasis: "weak",
67
- class: "tw-text-button-negative-text group-hover:tw-text-button-negative-text-hovergroup-active:tw-text-button-negative-text-pressed"
68
- },
69
- {
70
- disabled: !1,
71
- style: "negative",
72
- emphasis: "strong",
73
- class: "tw-text-button-strong-negative-text group-hover:tw-text-button-strong-negative-text-hovergroup-active:tw-text-button-strong-negative-text-pressed"
74
- },
75
- {
76
- disabled: !1,
77
- style: "danger",
78
- emphasis: "default",
79
- class: "tw-text-button-negative-icon group-hover:tw-text-button-negative-icon-hovergroup-active:tw-text-button-negative-icon-pressed"
80
- },
81
- {
82
- disabled: !1,
83
- style: "danger",
84
- emphasis: "weak",
85
- class: "tw-text-button-negative-icon group-hover:tw-text-button-negative-icon-hovergroup-active:tw-text-button-negative-icon-pressed"
86
- },
87
- {
88
- disabled: !1,
89
- style: "danger",
90
- emphasis: "strong",
91
- class: "tw-text-button-danger-text group-hover:tw-text-button-danger-text-hovergroup-active:tw-text-button-danger-text-pressed"
92
- },
93
- {
94
- disabled: !1,
95
- style: "loud",
96
- emphasis: "default",
97
- class: "tw-text-box-selected-inverse group-hover:tw-text-box-selected-inverse-hovergroup-active:tw-text-box-selected-inverse-pressed"
98
- },
99
- {
100
- disabled: !1,
101
- style: "loud",
102
- emphasis: "weak",
103
- class: "tw-text-box-selected-inverse group-hover:tw-text-box-selected-inverse-hovergroup-active:tw-text-box-selected-inverse-pressed"
104
- },
105
- {
106
- disabled: !1,
107
- style: "loud",
108
- emphasis: "strong",
109
- class: "tw-text-box-selected-strong-inverse group-hover:tw-text-box-selected-strong-inversegroup-active:tw-text-box-selected-strong-inverse"
110
- }
111
- ],
112
- defaultVariants: {
113
- emphasis: "strong",
114
- style: "default",
115
- disabled: !1
116
- }
117
- });
30
+ );
31
+ };
32
+ d.displayName = "SegmentedControl.Root";
33
+ const i = ({ children: e, ...o }, s) => /* @__PURE__ */ l(r.Item, { ref: s, ...o, className: y, asChild: !1, children: [
34
+ /* @__PURE__ */ t("span", { className: N }),
35
+ /* @__PURE__ */ l("span", { className: u, children: [
36
+ /* @__PURE__ */ t("span", { className: b, children: e }),
37
+ /* @__PURE__ */ t("span", { className: h, children: e })
38
+ ] })
39
+ ] });
40
+ i.displayName = "SegmentedControl.Item";
41
+ const j = {
42
+ Root: m(d),
43
+ Item: m(i)
44
+ };
118
45
  export {
119
- s as textStyles
46
+ j as SegmentedControl,
47
+ i as SegmentedControlItem,
48
+ d as SegmentedControlRoot
120
49
  };
121
50
  //# sourceMappingURL=fondue-components10.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components10.js","sources":["../src/components/Button/styles/textStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const textStyles = sv({\n variants: {\n emphasis: {\n default: '',\n weak: '',\n strong: '',\n },\n style: {\n default: '',\n positive: '',\n negative: '',\n danger: '',\n loud: '',\n },\n disabled: {\n true: 'tw-text-box-disabled-inverse',\n },\n },\n compoundVariants: [\n {\n disabled: false,\n style: 'default',\n emphasis: 'default',\n class:\n 'tw-text-button-text ' +\n 'group-hover:tw-text-button-text-hover ' +\n 'group-active:tw-text-button-text-pressed',\n },\n {\n disabled: false,\n style: 'default',\n emphasis: 'weak',\n class:\n 'tw-text-button-text ' +\n 'group-hover:tw-text-button-text-hover ' +\n 'group-active:tw-text-button-text-pressed',\n },\n {\n disabled: false,\n style: 'default',\n emphasis: 'strong',\n class:\n 'tw-text-button-strong-icon ' +\n 'group-hover:tw-text-button-strong-icon-hover ' +\n 'group-active:tw-text-button-strong-text-pressed',\n },\n {\n disabled: false,\n style: 'positive',\n emphasis: 'default',\n class:\n 'tw-text-button-positive-text ' +\n 'group-hover:tw-text-button-positive-text-hover ' +\n 'group-active:tw-text-button-positive-text-pressed',\n },\n {\n disabled: false,\n style: 'positive',\n emphasis: 'weak',\n class:\n 'tw-text-button-positive-text ' +\n 'group-hover:tw-text-button-positive-text-hover ' +\n 'group-active:tw-text-button-positive-text-pressed',\n },\n {\n disabled: false,\n style: 'positive',\n emphasis: 'strong',\n class:\n 'tw-text-button-strong-positive-text ' +\n 'group-hover:tw-text-button-strong-positive-text-hover ' +\n 'group-active:tw-text-button-strong-positive-text-pressed',\n },\n {\n disabled: false,\n style: 'negative',\n emphasis: 'default',\n class:\n 'tw-text-button-negative-text ' +\n 'group-hover:tw-text-button-negative-text-hover' +\n 'group-active:tw-text-button-negative-text-pressed',\n },\n {\n disabled: false,\n style: 'negative',\n emphasis: 'weak',\n class:\n 'tw-text-button-negative-text ' +\n 'group-hover:tw-text-button-negative-text-hover' +\n 'group-active:tw-text-button-negative-text-pressed',\n },\n {\n disabled: false,\n style: 'negative',\n emphasis: 'strong',\n class:\n 'tw-text-button-strong-negative-text ' +\n 'group-hover:tw-text-button-strong-negative-text-hover' +\n 'group-active:tw-text-button-strong-negative-text-pressed',\n },\n {\n disabled: false,\n style: 'danger',\n emphasis: 'default',\n class:\n 'tw-text-button-negative-icon ' +\n 'group-hover:tw-text-button-negative-icon-hover' +\n 'group-active:tw-text-button-negative-icon-pressed',\n },\n {\n disabled: false,\n style: 'danger',\n emphasis: 'weak',\n class:\n 'tw-text-button-negative-icon ' +\n 'group-hover:tw-text-button-negative-icon-hover' +\n 'group-active:tw-text-button-negative-icon-pressed',\n },\n {\n disabled: false,\n style: 'danger',\n emphasis: 'strong',\n class:\n 'tw-text-button-danger-text ' +\n 'group-hover:tw-text-button-danger-text-hover' +\n 'group-active:tw-text-button-danger-text-pressed',\n },\n {\n disabled: false,\n style: 'loud',\n emphasis: 'default',\n class:\n 'tw-text-box-selected-inverse ' +\n 'group-hover:tw-text-box-selected-inverse-hover' +\n 'group-active:tw-text-box-selected-inverse-pressed',\n },\n {\n disabled: false,\n style: 'loud',\n emphasis: 'weak',\n class:\n 'tw-text-box-selected-inverse ' +\n 'group-hover:tw-text-box-selected-inverse-hover' +\n 'group-active:tw-text-box-selected-inverse-pressed',\n },\n {\n disabled: false,\n style: 'loud',\n emphasis: 'strong',\n class:\n 'tw-text-box-selected-strong-inverse ' +\n 'group-hover:tw-text-box-selected-strong-inverse' +\n 'group-active:tw-text-box-selected-strong-inverse',\n },\n ],\n defaultVariants: {\n emphasis: 'strong',\n style: 'default',\n disabled: false,\n },\n});\n"],"names":["textStyles","sv"],"mappings":";AAIO,MAAMA,IAAaC,EAAG;AAAA,EACzB,UAAU;AAAA,IACN,UAAU;AAAA,MACN,SAAS;AAAA,MACT,MAAM;AAAA,MACN,QAAQ;AAAA,IACZ;AAAA,IACA,OAAO;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,MAAM;AAAA,IACV;AAAA,IACA,UAAU;AAAA,MACN,MAAM;AAAA,IACV;AAAA,EACJ;AAAA,EACA,kBAAkB;AAAA,IACd;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,IACA;AAAA,MACI,UAAU;AAAA,MACV,OAAO;AAAA,MACP,UAAU;AAAA,MACV,OACI;AAAA,IAGR;AAAA,EACJ;AAAA,EACA,iBAAiB;AAAA,IACb,UAAU;AAAA,IACV,OAAO;AAAA,IACP,UAAU;AAAA,EACd;AACJ,CAAC;"}
1
+ {"version":3,"file":"fondue-components10.js","sources":["../src/components/SegmentedControl/SegmentedControl.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport { forwardRef, type ForwardedRef, type ReactNode } from 'react';\n\nimport { useControllableState } from '#/hooks/useControllableState';\n\nimport {\n segmentedControlActiveIndicatorStyles,\n segmentedControlItemLabelActiveStyles,\n segmentedControlItemLabelInactiveStyles,\n segmentedControlItemLabelStyles,\n segmentedControlItemSeparatorStyles,\n segmentedControlItemStyles,\n segmentedControlRootStyles,\n} from './styles/segmentedControlStyles';\n\nexport type SegmentedControlRootProps = {\n id?: string;\n children: ReactNode;\n /**\n * The default value of the segmented control\n * Used for uncontrolled components\n */\n defaultValue: string;\n /**\n * The controlled value of the segmented control\n */\n value?: string;\n /**\n * Event handler called when the value changes\n */\n onValueChange?: (value: string) => void;\n /**\n * Disable the segmented control\n * @default false\n */\n disabled?: boolean;\n};\n\nexport const SegmentedControlRoot = (\n { children, value: propsValue, defaultValue, onValueChange, ...rootProps }: SegmentedControlRootProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n const [value, setValue] = useControllableState({\n prop: propsValue,\n defaultProp: defaultValue,\n onChange: onValueChange,\n });\n\n return (\n <ToggleGroupPrimitive.Root\n ref={ref}\n {...rootProps}\n className={segmentedControlRootStyles}\n onValueChange={(value) => {\n if (value) {\n setValue(value);\n }\n }}\n value={value}\n type=\"single\"\n asChild={false}\n aria-disabled={rootProps.disabled}\n >\n {children}\n {/* Active indicator */}\n <div className={segmentedControlActiveIndicatorStyles} />\n </ToggleGroupPrimitive.Root>\n );\n};\nSegmentedControlRoot.displayName = 'SegmentedControl.Root';\n\ntype SegmentedControlItemProps = {\n children: ReactNode;\n value: string;\n};\n\nexport const SegmentedControlItem = (\n { children, ...itemProps }: SegmentedControlItemProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) => (\n <ToggleGroupPrimitive.Item ref={ref} {...itemProps} className={segmentedControlItemStyles} asChild={false}>\n {/* Separator */}\n <span className={segmentedControlItemSeparatorStyles} />\n <span className={segmentedControlItemLabelStyles}>\n {/* Active children */}\n <span className={segmentedControlItemLabelActiveStyles}>{children}</span>\n\n {/* Inactive children */}\n <span className={segmentedControlItemLabelInactiveStyles}>{children}</span>\n </span>\n </ToggleGroupPrimitive.Item>\n);\nSegmentedControlItem.displayName = 'SegmentedControl.Item';\n\nexport const SegmentedControl = {\n Root: forwardRef<HTMLDivElement, SegmentedControlRootProps>(SegmentedControlRoot),\n Item: forwardRef<HTMLButtonElement, SegmentedControlItemProps>(SegmentedControlItem),\n};\n"],"names":["SegmentedControlRoot","children","propsValue","defaultValue","onValueChange","rootProps","ref","value","setValue","useControllableState","jsxs","ToggleGroupPrimitive","segmentedControlRootStyles","jsx","segmentedControlActiveIndicatorStyles","SegmentedControlItem","itemProps","segmentedControlItemStyles","segmentedControlItemSeparatorStyles","segmentedControlItemLabelStyles","segmentedControlItemLabelActiveStyles","segmentedControlItemLabelInactiveStyles","SegmentedControl","forwardRef"],"mappings":";;;;;AAwCa,MAAAA,IAAuB,CAChC,EAAE,UAAAC,GAAU,OAAOC,GAAY,cAAAC,GAAc,eAAAC,GAAe,GAAGC,EAAU,GACzEC,MACC;AACD,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAqB;AAAA,IAC3C,MAAMP;AAAA,IACN,aAAaC;AAAA,IACb,UAAUC;AAAA,EAAA,CACb;AAGG,SAAA,gBAAAM;AAAA,IAACC,EAAqB;AAAA,IAArB;AAAA,MACG,KAAAL;AAAA,MACC,GAAGD;AAAA,MACJ,WAAWO;AAAA,MACX,eAAe,CAACL,MAAU;AACtB,QAAIA,KACAC,EAASD,CAAK;AAAA,MAEtB;AAAA,MACA,OAAAA;AAAA,MACA,MAAK;AAAA,MACL,SAAS;AAAA,MACT,iBAAeF,EAAU;AAAA,MAExB,UAAA;AAAA,QAAAJ;AAAA,QAED,gBAAAY,EAAC,OAAI,EAAA,WAAWC,EAAuC,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGnE;AACAd,EAAqB,cAAc;AAO5B,MAAMe,IAAuB,CAChC,EAAE,UAAAd,GAAU,GAAGe,EAAA,GACfV,MAEA,gBAAAI,EAACC,EAAqB,MAArB,EAA0B,KAAAL,GAAW,GAAGU,GAAW,WAAWC,GAA4B,SAAS,IAEhG,UAAA;AAAA,EAAC,gBAAAJ,EAAA,QAAA,EAAK,WAAWK,EAAqC,CAAA;AAAA,EACtD,gBAAAR,EAAC,QAAK,EAAA,WAAWS,GAEb,UAAA;AAAA,IAAC,gBAAAN,EAAA,QAAA,EAAK,WAAWO,GAAwC,UAAAnB,EAAS,CAAA;AAAA,IAGjE,gBAAAY,EAAA,QAAA,EAAK,WAAWQ,GAA0C,UAAApB,EAAS,CAAA;AAAA,EAAA,GACxE;AAAA,GACJ;AAEJc,EAAqB,cAAc;AAE5B,MAAMO,IAAmB;AAAA,EAC5B,MAAMC,EAAsDvB,CAAoB;AAAA,EAChF,MAAMuB,EAAyDR,CAAoB;AACvF;"}
@@ -1,38 +1,53 @@
1
- import { sv as t } from "./fondue-components7.js";
2
- const a = t({
3
- base: "tw-relative tw-w-full tw-overflow-hidden",
4
- variants: {
5
- rounded: {
6
- true: "tw-rounded"
7
- },
8
- size: {
9
- small: "tw-h-1",
10
- medium: "tw-h-2",
11
- large: "tw-h-3",
12
- "x-large": "tw-h-4"
13
- },
14
- style: {
15
- default: "tw-bg-box-selected",
16
- positive: "tw-bg-box-positive",
17
- negative: "tw-bg-box-negative"
1
+ import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
+ import { IconCheckMark as p, IconExclamationMarkTriangle as u } from "@frontify/fondue-icons";
3
+ import { forwardRef as a } from "react";
4
+ import { cn as i } from "./fondue-components14.js";
5
+ import { rootStyles as w, loadingStatusStyles as S, inputStyles as F, slotStyles as N } from "./fondue-components25.js";
6
+ const s = ({
7
+ children: l,
8
+ className: r,
9
+ status: t = "neutral",
10
+ "data-test-id": e = "fondue-text-input",
11
+ ...m
12
+ }, x) => /* @__PURE__ */ f("div", { className: i(w, r), "data-status": t, "data-test-id": e, children: [
13
+ t === "loading" ? /* @__PURE__ */ o("div", { className: S, "data-test-id": `${e}-loader` }) : null,
14
+ /* @__PURE__ */ o("input", { type: "text", ...m, ref: x, className: F, "aria-invalid": t === "error" }),
15
+ t === "success" ? /* @__PURE__ */ o(
16
+ p,
17
+ {
18
+ size: 16,
19
+ className: "tw-flex tw-text-text-positive tw-h-full tw-items-center tw-ml-3",
20
+ "data-test-id": `${e}-success-icon`
18
21
  }
19
- }
20
- }), i = t({
21
- base: "tw-h-full tw-w-full",
22
- variants: {
23
- style: {
24
- default: "tw-bg-text-interactive",
25
- positive: "tw-bg-text-positive",
26
- negative: "tw-bg-text-negative"
27
- },
28
- indeterminateState: {
29
- true: "tw-animate-loading-bar-infinite tw-origin-left-right",
30
- false: "tw-transition-all tw--translate-x-[calc(100%-var(--loading-bar-value))]"
22
+ ) : null,
23
+ t === "error" ? /* @__PURE__ */ o(
24
+ u,
25
+ {
26
+ size: 16,
27
+ className: "tw-flex tw-text-text-negative tw-h-full tw-items-center tw-ml-3",
28
+ "data-test-id": `${e}-error-icon`
31
29
  }
30
+ ) : null,
31
+ l
32
+ ] });
33
+ s.displayName = "TextField.Root";
34
+ const n = ({ name: l, className: r, ...t }, e) => /* @__PURE__ */ o(
35
+ "div",
36
+ {
37
+ "data-slot": !0,
38
+ "data-name": l,
39
+ ...t,
40
+ ref: e,
41
+ className: i(N, r)
32
42
  }
33
- });
43
+ );
44
+ n.displayName = "TextField.Slot";
45
+ const d = a(s), y = a(n), c = d;
46
+ c.Root = d;
47
+ c.Slot = y;
34
48
  export {
35
- a as loadingBarContainerStyles,
36
- i as loadingBarStyles
49
+ s as TextFieldRoot,
50
+ n as TextFieldSlot,
51
+ c as TextInput
37
52
  };
38
53
  //# sourceMappingURL=fondue-components11.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fondue-components11.js","sources":["../src/components/LoadingBar/styles/loadingBarStyles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { sv } from '#/utilities/styleUtilities';\n\nexport const loadingBarContainerStyles = sv({\n base: 'tw-relative tw-w-full tw-overflow-hidden',\n variants: {\n rounded: {\n true: 'tw-rounded',\n },\n size: {\n small: 'tw-h-1',\n medium: 'tw-h-2',\n large: 'tw-h-3',\n 'x-large': 'tw-h-4',\n },\n style: {\n default: 'tw-bg-box-selected',\n positive: 'tw-bg-box-positive',\n negative: 'tw-bg-box-negative',\n },\n },\n});\n\nexport const loadingBarStyles = sv({\n base: 'tw-h-full tw-w-full',\n variants: {\n style: {\n default: 'tw-bg-text-interactive',\n positive: 'tw-bg-text-positive',\n negative: 'tw-bg-text-negative',\n },\n indeterminateState: {\n true: 'tw-animate-loading-bar-infinite tw-origin-left-right',\n false: 'tw-transition-all tw--translate-x-[calc(100%-var(--loading-bar-value))]',\n },\n },\n});\n"],"names":["loadingBarContainerStyles","sv","loadingBarStyles"],"mappings":";AAIO,MAAMA,IAA4BC,EAAG;AAAA,EACxC,MAAM;AAAA,EACN,UAAU;AAAA,IACN,SAAS;AAAA,MACL,MAAM;AAAA,IACV;AAAA,IACA,MAAM;AAAA,MACF,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,MACP,WAAW;AAAA,IACf;AAAA,IACA,OAAO;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACd;AAAA,EACJ;AACJ,CAAC,GAEYC,IAAmBD,EAAG;AAAA,EAC/B,MAAM;AAAA,EACN,UAAU;AAAA,IACN,OAAO;AAAA,MACH,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,IACd;AAAA,IACA,oBAAoB;AAAA,MAChB,MAAM;AAAA,MACN,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,CAAC;"}
1
+ {"version":3,"file":"fondue-components11.js","sources":["../src/components/TextInput/TextInput.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconCheckMark, IconExclamationMarkTriangle } from '@frontify/fondue-icons';\nimport { forwardRef, type ChangeEvent, type ForwardedRef, type KeyboardEvent, type ReactNode } from 'react';\n\nimport { cn } from '#/utilities/styleUtilities';\n\nimport { inputStyles, loadingStatusStyles, rootStyles, slotStyles } from './styles/textInputStyles';\n\nexport type TextInputProps = {\n id?: string;\n name?: string;\n /**\n * The place where the input slots are placed\n */\n children?: ReactNode;\n /**\n * The default value of the text input\n * Used for uncontrolled components\n */\n defaultValue?: string | number;\n /**\n * The controlled value of the text input\n */\n value?: string | number;\n /**\n * Type of the text input\n * @default \"text\"\n */\n type?: 'date' | 'email' | 'hidden' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'time' | 'url';\n /**\n * The placeholder in the text input\n */\n placeholder?: string;\n /**\n * Disable the text input\n * @default false\n */\n disabled?: boolean;\n /**\n * Make the text input required in form\n * @default false\n */\n required?: boolean;\n /**\n * Make the text input spell-checkable\n * @default true\n */\n spellCheck?: boolean;\n /**\n * Make the text input read-only\n * @default false\n */\n readOnly?: boolean;\n /**\n * Set the type of input so autocomplete can help the user\n * @default \"on\"\n */\n autoComplete?: string;\n /**\n * The maximum length of the text input\n */\n maxLength?: number;\n /**\n * Status of the text input\n * @default \"neutral\"\n */\n status?: 'neutral' | 'success' | 'error' | 'loading';\n className?: string;\n /**\n * Event handler called when the text input value changes\n */\n onChange?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text input is blurred\n */\n onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when the text input is focused\n */\n onFocus?: (event: ChangeEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when a key is pressed\n */\n onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;\n /**\n * Event handler called when a key is released\n */\n onKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;\n 'data-test-id'?: string;\n 'aria-label'?: string;\n 'aria-labelledby'?: string;\n 'aria-describedby'?: string;\n};\n\nexport const TextFieldRoot = (\n {\n children,\n className,\n status = 'neutral',\n 'data-test-id': dataTestId = 'fondue-text-input',\n ...inputProps\n }: TextInputProps,\n ref: ForwardedRef<HTMLInputElement>,\n) => {\n return (\n <div className={cn(rootStyles, className)} data-status={status} data-test-id={dataTestId}>\n {status === 'loading' ? (\n <div className={loadingStatusStyles} data-test-id={`${dataTestId}-loader`} />\n ) : null}\n\n <input type=\"text\" {...inputProps} ref={ref} className={inputStyles} aria-invalid={status === 'error'} />\n\n {status === 'success' ? (\n <IconCheckMark\n size={16}\n className=\"tw-flex tw-text-text-positive tw-h-full tw-items-center tw-ml-3\"\n data-test-id={`${dataTestId}-success-icon`}\n />\n ) : null}\n\n {status === 'error' ? (\n <IconExclamationMarkTriangle\n size={16}\n className=\"tw-flex tw-text-text-negative tw-h-full tw-items-center tw-ml-3\"\n data-test-id={`${dataTestId}-error-icon`}\n />\n ) : null}\n\n {children}\n </div>\n );\n};\nTextFieldRoot.displayName = 'TextField.Root';\n\nexport type TextFieldSlotProps = {\n children: ReactNode;\n name?: 'left' | 'right';\n className?: string;\n};\n\nexport const TextFieldSlot = (\n { name, className, ...slotProps }: TextFieldSlotProps,\n forwardedRef: ForwardedRef<HTMLDivElement>,\n) => {\n return (\n <div\n data-slot={true}\n data-name={name}\n {...slotProps}\n ref={forwardedRef}\n className={cn(slotStyles, className)}\n />\n );\n};\n\nTextFieldSlot.displayName = 'TextField.Slot';\n\nconst ForwardedRefTextFieldRoot = forwardRef<HTMLInputElement, TextInputProps>(TextFieldRoot);\nconst ForwardedRefTextFieldSlot = forwardRef<HTMLDivElement, TextFieldSlotProps>(TextFieldSlot);\n// @ts-expect-error We support both single component (without slots) and compound components (with slots)\nexport const TextInput: typeof TextFieldRoot & {\n Root: typeof ForwardedRefTextFieldRoot;\n Slot: typeof ForwardedRefTextFieldSlot;\n} = ForwardedRefTextFieldRoot;\nTextInput.Root = ForwardedRefTextFieldRoot;\nTextInput.Slot = ForwardedRefTextFieldSlot;\n"],"names":["TextFieldRoot","children","className","status","dataTestId","inputProps","ref","jsxs","cn","rootStyles","loadingStatusStyles","jsx","inputStyles","IconCheckMark","IconExclamationMarkTriangle","TextFieldSlot","name","slotProps","forwardedRef","slotStyles","ForwardedRefTextFieldRoot","forwardRef","ForwardedRefTextFieldSlot","TextInput"],"mappings":";;;;;AA+FO,MAAMA,IAAgB,CACzB;AAAA,EACI,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,gBAAgBC,IAAa;AAAA,EAC7B,GAAGC;AACP,GACAC,MAGI,gBAAAC,EAAC,OAAI,EAAA,WAAWC,EAAGC,GAAYP,CAAS,GAAG,eAAaC,GAAQ,gBAAcC,GACzE,UAAA;AAAA,EAAWD,MAAA,8BACP,OAAI,EAAA,WAAWO,GAAqB,gBAAc,GAAGN,CAAU,UAAA,CAAW,IAC3E;AAAA,EAEJ,gBAAAO,EAAC,SAAM,EAAA,MAAK,QAAQ,GAAGN,GAAY,KAAAC,GAAU,WAAWM,GAAa,gBAAcT,MAAW,QAAS,CAAA;AAAA,EAEtGA,MAAW,YACR,gBAAAQ;AAAA,IAACE;AAAA,IAAA;AAAA,MACG,MAAM;AAAA,MACN,WAAU;AAAA,MACV,gBAAc,GAAGT,CAAU;AAAA,IAAA;AAAA,EAAA,IAE/B;AAAA,EAEHD,MAAW,UACR,gBAAAQ;AAAA,IAACG;AAAA,IAAA;AAAA,MACG,MAAM;AAAA,MACN,WAAU;AAAA,MACV,gBAAc,GAAGV,CAAU;AAAA,IAAA;AAAA,EAAA,IAE/B;AAAA,EAEHH;AACL,EAAA,CAAA;AAGRD,EAAc,cAAc;AAQf,MAAAe,IAAgB,CACzB,EAAE,MAAAC,GAAM,WAAAd,GAAW,GAAGe,KACtBC,MAGI,gBAAAP;AAAA,EAAC;AAAA,EAAA;AAAA,IACG,aAAW;AAAA,IACX,aAAWK;AAAA,IACV,GAAGC;AAAA,IACJ,KAAKC;AAAA,IACL,WAAWV,EAAGW,GAAYjB,CAAS;AAAA,EAAA;AAAA;AAK/Ca,EAAc,cAAc;AAE5B,MAAMK,IAA4BC,EAA6CrB,CAAa,GACtFsB,IAA4BD,EAA+CN,CAAa,GAEjFQ,IAGTH;AACJG,EAAU,OAAOH;AACjBG,EAAU,OAAOD;"}