@telia/teddy 0.0.33 → 0.0.35

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 (129) hide show
  1. package/dist/components/box/box.cjs +2 -2
  2. package/dist/components/box/box.js +2 -2
  3. package/dist/components/chip/chip-indicator.d.ts +1 -1
  4. package/dist/components/chip/index.d.ts +1 -1
  5. package/dist/components/color-dot/color-dot-root.cjs +29 -0
  6. package/dist/components/color-dot/color-dot-root.d.ts +20 -0
  7. package/dist/components/color-dot/color-dot-root.js +29 -0
  8. package/dist/components/color-dot/index.cjs +5 -0
  9. package/dist/components/color-dot/index.d.ts +12 -0
  10. package/dist/components/color-dot/index.js +5 -0
  11. package/dist/components/drawer/drawer-close.cjs +1 -1
  12. package/dist/components/drawer/drawer-close.js +1 -1
  13. package/dist/components/drawer/drawer-content.cjs +10 -2
  14. package/dist/components/drawer/drawer-content.d.ts +1 -0
  15. package/dist/components/drawer/drawer-content.js +10 -2
  16. package/dist/components/drawer/drawer-description.cjs +1 -1
  17. package/dist/components/drawer/drawer-description.js +1 -1
  18. package/dist/components/drawer/drawer-footer.cjs +1 -1
  19. package/dist/components/drawer/drawer-footer.js +1 -1
  20. package/dist/components/drawer/drawer-overlay.cjs +1 -1
  21. package/dist/components/drawer/drawer-overlay.js +1 -1
  22. package/dist/components/drawer/drawer-title.cjs +1 -1
  23. package/dist/components/drawer/drawer-title.js +1 -1
  24. package/dist/components/expandable-card/expandable-card-button.cjs +29 -0
  25. package/dist/components/expandable-card/expandable-card-button.d.ts +33 -0
  26. package/dist/components/expandable-card/expandable-card-button.js +29 -0
  27. package/dist/components/expandable-card/expandable-card-content.cjs +32 -0
  28. package/dist/components/expandable-card/expandable-card-content.d.ts +5 -0
  29. package/dist/components/expandable-card/expandable-card-content.js +15 -0
  30. package/dist/components/expandable-card/expandable-card-description.cjs +14 -0
  31. package/dist/components/expandable-card/expandable-card-description.d.ts +5 -0
  32. package/dist/components/expandable-card/expandable-card-description.js +14 -0
  33. package/dist/components/expandable-card/expandable-card-header.cjs +13 -0
  34. package/dist/components/expandable-card/expandable-card-header.d.ts +4 -0
  35. package/dist/components/expandable-card/expandable-card-header.js +13 -0
  36. package/dist/components/expandable-card/expandable-card-hidden.cjs +13 -0
  37. package/dist/components/expandable-card/expandable-card-hidden.d.ts +4 -0
  38. package/dist/components/expandable-card/expandable-card-hidden.js +13 -0
  39. package/dist/components/expandable-card/expandable-card-indicator.cjs +16 -0
  40. package/dist/components/expandable-card/expandable-card-indicator.d.ts +7 -0
  41. package/dist/components/expandable-card/expandable-card-indicator.js +16 -0
  42. package/dist/components/expandable-card/expandable-card-item.cjs +36 -0
  43. package/dist/components/expandable-card/expandable-card-item.d.ts +5 -0
  44. package/dist/components/expandable-card/expandable-card-item.js +19 -0
  45. package/dist/components/expandable-card/expandable-card-line.cjs +16 -0
  46. package/dist/components/expandable-card/expandable-card-line.d.ts +8 -0
  47. package/dist/components/expandable-card/expandable-card-line.js +16 -0
  48. package/dist/components/expandable-card/expandable-card-price.cjs +13 -0
  49. package/dist/components/expandable-card/expandable-card-price.d.ts +4 -0
  50. package/dist/components/expandable-card/expandable-card-price.js +13 -0
  51. package/dist/components/expandable-card/expandable-card-root.cjs +51 -0
  52. package/dist/components/expandable-card/expandable-card-root.d.ts +6 -0
  53. package/dist/components/expandable-card/expandable-card-root.js +34 -0
  54. package/dist/components/expandable-card/expandable-card-slot.cjs +33 -0
  55. package/dist/components/expandable-card/expandable-card-slot.d.ts +8 -0
  56. package/dist/components/expandable-card/expandable-card-slot.js +33 -0
  57. package/dist/components/expandable-card/expandable-card-trigger.cjs +35 -0
  58. package/dist/components/expandable-card/expandable-card-trigger.d.ts +8 -0
  59. package/dist/components/expandable-card/expandable-card-trigger.js +18 -0
  60. package/dist/components/expandable-card/index.cjs +37 -0
  61. package/dist/components/expandable-card/index.d.ts +61 -0
  62. package/dist/components/expandable-card/index.js +37 -0
  63. package/dist/components/flex/flex.cjs +2 -2
  64. package/dist/components/flex/flex.js +2 -2
  65. package/dist/components/grid/grid.cjs +2 -2
  66. package/dist/components/grid/grid.js +2 -2
  67. package/dist/components/index.cjs +8 -2
  68. package/dist/components/index.d.ts +3 -0
  69. package/dist/components/index.js +7 -1
  70. package/dist/components/list/index.d.ts +3 -0
  71. package/dist/components/list/list.cjs +15 -15
  72. package/dist/components/list/list.d.ts +6 -1
  73. package/dist/components/list/list.js +15 -15
  74. package/dist/components/modal/modal.cjs +4 -1
  75. package/dist/components/modal/modal.js +4 -1
  76. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.cjs +40 -16
  77. package/dist/components/navigation-menu/global-navigation/global-navigation-my-pages.js +40 -16
  78. package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +7 -9
  79. package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.cjs +4 -0
  80. package/dist/components/navigation-menu/global-navigation/global-navigation-shopping-cart.js +4 -0
  81. package/dist/components/navigation-menu/navigation-menu.d.ts +1 -1
  82. package/dist/components/notabene/notabene-icon.d.ts +1 -1
  83. package/dist/components/notabene/notabene-root.cjs +3 -3
  84. package/dist/components/notabene/notabene-root.js +3 -3
  85. package/dist/components/notification/notification.d.ts +1 -1
  86. package/dist/components/progress-bar/progress-bar.d.ts +1 -1
  87. package/dist/components/radio-group/index.cjs +20 -2
  88. package/dist/components/radio-group/index.d.ts +70 -2
  89. package/dist/components/radio-group/index.js +19 -1
  90. package/dist/components/radio-group/radio-group-indicator.cjs +32 -0
  91. package/dist/components/radio-group/radio-group-indicator.d.ts +5 -0
  92. package/dist/components/radio-group/radio-group-indicator.js +15 -0
  93. package/dist/components/radio-group/radio-group-item-label.cjs +18 -0
  94. package/dist/components/radio-group/radio-group-item-label.d.ts +15 -0
  95. package/dist/components/radio-group/radio-group-item-label.js +18 -0
  96. package/dist/components/radio-group/radio-group-item.cjs +16 -0
  97. package/dist/components/radio-group/radio-group-item.d.ts +9 -0
  98. package/dist/components/radio-group/radio-group-item.js +16 -0
  99. package/dist/components/radio-group/radio-group-label.cjs +29 -0
  100. package/dist/components/radio-group/radio-group-label.d.ts +66 -0
  101. package/dist/components/radio-group/radio-group-label.js +29 -0
  102. package/dist/components/radio-group/radio-group-root.cjs +46 -0
  103. package/dist/components/radio-group/radio-group-root.d.ts +52 -0
  104. package/dist/components/radio-group/radio-group-root.js +29 -0
  105. package/dist/components/radio-group/radio-group-trigger.cjs +38 -0
  106. package/dist/components/radio-group/radio-group-trigger.d.ts +14 -0
  107. package/dist/components/radio-group/radio-group-trigger.js +21 -0
  108. package/dist/components/ribbon/index.cjs +6 -0
  109. package/dist/components/ribbon/index.d.ts +6 -0
  110. package/dist/components/ribbon/index.js +6 -0
  111. package/dist/components/ribbon/ribbon-root.cjs +32 -0
  112. package/dist/components/ribbon/ribbon-root.d.ts +13 -0
  113. package/dist/components/ribbon/ribbon-root.js +32 -0
  114. package/dist/components/tabs/index.d.ts +2 -2
  115. package/dist/components/tabs/tabs-root.d.ts +1 -1
  116. package/dist/components/tabs/tabs-trigger.d.ts +1 -1
  117. package/dist/components/toggle/toggle.d.ts +1 -1
  118. package/dist/components/tooltip/index.d.ts +1 -1
  119. package/dist/drawer.module-BPXo6-Q2.js +15 -0
  120. package/dist/drawer.module-_pUdp_M1.cjs +14 -0
  121. package/dist/main.cjs +8 -2
  122. package/dist/main.js +7 -1
  123. package/dist/style.css +731 -518
  124. package/package.json +1 -1
  125. package/dist/components/radio-group/radio-group.cjs +0 -110
  126. package/dist/components/radio-group/radio-group.d.ts +0 -161
  127. package/dist/components/radio-group/radio-group.js +0 -93
  128. package/dist/drawer.module-BZV0Appw.js +0 -14
  129. package/dist/drawer.module-rgUBNOkt.cjs +0 -13
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "pnpm": ">=8"
21
21
  },
22
22
  "private": false,
23
- "version": "0.0.33",
23
+ "version": "0.0.35",
24
24
  "sideEffects": [
25
25
  "**/*.css"
26
26
  ],
@@ -1,110 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const clsx = require("clsx");
6
- const RadioGroupPrimitive = require("@radix-ui/react-radio-group");
7
- const components_label_label = require("../label/label.cjs");
8
- const utils_composeRefs = require("../../utils/composeRefs.cjs");
9
- const reactSlot = require("@radix-ui/react-slot");
10
- function _interopNamespaceDefault(e) {
11
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
12
- if (e) {
13
- for (const k in e) {
14
- if (k !== "default") {
15
- const d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: () => e[k]
19
- });
20
- }
21
- }
22
- }
23
- n.default = e;
24
- return Object.freeze(n);
25
- }
26
- const RadioGroupPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadioGroupPrimitive);
27
- const styles = {
28
- "teddy-radio-group": "_teddy-radio-group_1flae_1",
29
- "teddy-radio-group__group-label": "_teddy-radio-group__group-label_1flae_10",
30
- "teddy-radio-group__label": "_teddy-radio-group__label_1flae_13",
31
- "teddy-radio-group__group-label--required": "_teddy-radio-group__group-label--required_1flae_23",
32
- "teddy-radio-group__item": "_teddy-radio-group__item_1flae_26",
33
- "teddy-radio-group__trigger": "_teddy-radio-group__trigger_1flae_54",
34
- "teddy-radio-group__indicator": "_teddy-radio-group__indicator_1flae_111"
35
- };
36
- const rootClassName = "teddy-radio-group";
37
- const RootContext = React.createContext(void 0);
38
- const Root = React.forwardRef(
39
- ({ className, ...props }, forwardRef) => {
40
- const classes = clsx([styles[`${rootClassName}`]], className);
41
- const [groupLabelId, setGroupLabelId] = React.useState();
42
- return /* @__PURE__ */ jsxRuntime.jsx(RootContext.Provider, { value: { setGroupLabelId, required: props.required }, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Root, { "aria-labelledby": groupLabelId, ...props, ref: forwardRef, className: classes }) });
43
- }
44
- );
45
- Root.displayName = "RadioGroup";
46
- const ItemContext = React.createContext(
47
- void 0
48
- );
49
- const Item = React.forwardRef(({ className, ...props }, forwardRef) => {
50
- const classes = clsx([styles[`${rootClassName}__item`]], className);
51
- const triggerRef = React.useRef(null);
52
- const triggerId = `${React.useId()}-trigger`;
53
- return /* @__PURE__ */ jsxRuntime.jsx(ItemContext.Provider, { value: { triggerRef, id: triggerId }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: forwardRef, className: classes }) });
54
- });
55
- Item.displayName = "RadioGroup.Item";
56
- const GroupLabel = React.forwardRef(
57
- ({ className, asChild, as: Tag = "h3", children, ...props }, forwardRef) => {
58
- const context = React.useContext(RootContext);
59
- const classes = clsx(
60
- [styles[`${rootClassName}__group-label`]],
61
- {
62
- [styles[`${rootClassName}__group-label--required`]]: context == null ? void 0 : context.required
63
- },
64
- className
65
- );
66
- const fallbackId = React.useId();
67
- const id = props.id || fallbackId;
68
- React.useEffect(() => {
69
- if (context) {
70
- context.setGroupLabelId(id);
71
- }
72
- }, [id, context]);
73
- return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ...props, id, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsxRuntime.jsx(Tag, { children }) : null });
74
- }
75
- );
76
- GroupLabel.displayName = "RadioGroup.GroupLabel";
77
- const Trigger = React.forwardRef(
78
- ({ className, children, ...props }, forwardRef) => {
79
- const classes = clsx([styles[`${rootClassName}__trigger`]], className);
80
- const context = React.useContext(ItemContext);
81
- const ref = utils_composeRefs.useComposedRefs(forwardRef, context == null ? void 0 : context.triggerRef);
82
- const id = props.id || (context == null ? void 0 : context.id);
83
- return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Item, { ...props, id, ref, className: classes, children: children || /* @__PURE__ */ jsxRuntime.jsx(Indicator, {}) });
84
- }
85
- );
86
- Trigger.displayName = "RadioGroup.Trigger";
87
- const Indicator = React.forwardRef(
88
- ({ className, ...props }, forwardRef) => {
89
- const classes = clsx([styles[`${rootClassName}__indicator`]], className);
90
- return /* @__PURE__ */ jsxRuntime.jsx(RadioGroupPrimitive__namespace.Indicator, { ...props, ref: forwardRef, className: classes });
91
- }
92
- );
93
- Indicator.displayName = "RadioGroup.Indicator";
94
- const Label = React.forwardRef(
95
- ({ className, ...props }, forwardRef) => {
96
- const classes = clsx([styles[`${rootClassName}__label`]], className);
97
- const context = React.useContext(ItemContext);
98
- const htmlFor = props.htmlFor || (context == null ? void 0 : context.id);
99
- return /* @__PURE__ */ jsxRuntime.jsx(components_label_label.Label, { ...props, htmlFor, ref: forwardRef, className: classes });
100
- }
101
- );
102
- Label.displayName = "RadioGroup.Label";
103
- const RadioGroup = Object.assign(Root, {
104
- Item,
105
- Trigger,
106
- Indicator,
107
- Label,
108
- GroupLabel
109
- });
110
- exports.RadioGroup = RadioGroup;
@@ -1,161 +0,0 @@
1
- import { default as React } from 'react';
2
- import { Label as LabelPrimitive } from '../label';
3
-
4
- import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
5
- type RootProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {
6
- /** The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items. */
7
- defaultValue?: string;
8
- /** When `true`, prevents the user from interacting with radio items. */
9
- disabled?: boolean;
10
- /** The name of the group. Submitted with its owning form as part of a name/value pair. */
11
- name?: string;
12
- /** When `true`, indicates that the user must check a radio item before the owning form can be submitted. */
13
- required?: boolean;
14
- /** The controlled value of the radio item to check. Should be used in conjunction with onValueChange. */
15
- value?: string;
16
- /** Event handler called when the value changes. */
17
- onValueChange?: (value: string) => void;
18
- /** The orientation of the component. */
19
- orientation?: 'horizontal' | 'vertical';
20
- /** The reading direction of the radio group. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. */
21
- dir?: 'ltr' | 'rtl';
22
- /** When true, keyboard navigation will loop from last item to first, and vice versa.
23
- * @default true
24
- */
25
- loop?: boolean;
26
- };
27
- /** -------------------------------------------------------------------------------------------------
28
- * Item
29
- * -----------------------------------------------------------------------------------------------*/
30
- type ItemProps = React.ComponentPropsWithoutRef<'div'>;
31
- /** -------------------------------------------------------------------------------------------------
32
- * GroupLabel
33
- * -----------------------------------------------------------------------------------------------*/
34
- type GroupLabelProps = {
35
- id?: string;
36
- asChild?: false;
37
- } & (AsChildProps | H2Props | H3Props | H4Props | H5Props | H6Props);
38
- type AsChildProps = {
39
- /**
40
- * If `true`, the children element will be cloned and used instead of the heading element.
41
- */
42
- asChild: true;
43
- as?: never;
44
- } & React.ComponentPropsWithoutRef<'h1'>;
45
- type H2Props = {
46
- as?: 'h2';
47
- asChild?: false;
48
- } & React.ComponentPropsWithoutRef<'h2'>;
49
- type H3Props = {
50
- as?: 'h3';
51
- asChild?: false;
52
- } & React.ComponentPropsWithoutRef<'h3'>;
53
- type H4Props = {
54
- as?: 'h4';
55
- asChild?: false;
56
- } & React.ComponentPropsWithoutRef<'h4'>;
57
- type H5Props = {
58
- as?: 'h5';
59
- asChild?: false;
60
- } & React.ComponentPropsWithoutRef<'h5'>;
61
- type H6Props = {
62
- as?: 'h6';
63
- asChild?: false;
64
- } & React.ComponentPropsWithoutRef<'h6'>;
65
- /** -------------------------------------------------------------------------------------------------
66
- * Trigger
67
- * -----------------------------------------------------------------------------------------------*/
68
- type TriggerProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & {
69
- id?: string;
70
- /** The value given as data when submitted with a name. This is used to determine which radio button is selected. */
71
- value: string;
72
- };
73
- /** -------------------------------------------------------------------------------------------------
74
- * Indicator
75
- * -----------------------------------------------------------------------------------------------*/
76
- type IndicatorProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Indicator> & {};
77
- /** -------------------------------------------------------------------------------------------------
78
- * Label
79
- * -----------------------------------------------------------------------------------------------*/
80
- type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive> & {
81
- /** This is used to connect label and trigger. The connection is made automatically, but if you override the id in the trigger, you will need to provide the id here as well. */
82
- htmlFor?: string;
83
- };
84
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
85
- /** The value of the radio item that should be checked when initially rendered. Use when you do not need to control the state of the radio items. */
86
- defaultValue?: string | undefined;
87
- /** When `true`, prevents the user from interacting with radio items. */
88
- disabled?: boolean | undefined;
89
- /** The name of the group. Submitted with its owning form as part of a name/value pair. */
90
- name?: string | undefined;
91
- /** When `true`, indicates that the user must check a radio item before the owning form can be submitted. */
92
- required?: boolean | undefined;
93
- /** The controlled value of the radio item to check. Should be used in conjunction with onValueChange. */
94
- value?: string | undefined;
95
- /** Event handler called when the value changes. */
96
- onValueChange?: ((value: string) => void) | undefined;
97
- /** The orientation of the component. */
98
- orientation?: "horizontal" | "vertical" | undefined;
99
- /** The reading direction of the radio group. If omitted, inherits globally from DirectionProvider or assumes LTR (left-to-right) reading mode. */
100
- dir?: "ltr" | "rtl" | undefined;
101
- /** When true, keyboard navigation will loop from last item to first, and vice versa.
102
- * @default true
103
- */
104
- loop?: boolean | undefined;
105
- } & React.RefAttributes<HTMLDivElement>> & {
106
- Item: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
107
- Trigger: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
108
- id?: string | undefined;
109
- /** The value given as data when submitted with a name. This is used to determine which radio button is selected. */
110
- value: string;
111
- } & React.RefAttributes<HTMLButtonElement>>;
112
- Indicator: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
113
- Label: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-label').LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
114
- disabled?: boolean | undefined;
115
- isRequired?: boolean | undefined;
116
- } & React.RefAttributes<HTMLLabelElement>, "ref"> & {
117
- /** This is used to connect label and trigger. The connection is made automatically, but if you override the id in the trigger, you will need to provide the id here as well. */
118
- htmlFor?: string | undefined;
119
- } & React.RefAttributes<HTMLLabelElement>>;
120
- GroupLabel: React.ForwardRefExoticComponent<(({
121
- id?: string | undefined;
122
- asChild?: false | undefined;
123
- } & {
124
- as?: "h2" | undefined;
125
- asChild?: false | undefined;
126
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
127
- id?: string | undefined;
128
- asChild?: false | undefined;
129
- } & {
130
- as?: "h3" | undefined;
131
- asChild?: false | undefined;
132
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
133
- id?: string | undefined;
134
- asChild?: false | undefined;
135
- } & {
136
- as?: "h4" | undefined;
137
- asChild?: false | undefined;
138
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
139
- id?: string | undefined;
140
- asChild?: false | undefined;
141
- } & {
142
- as?: "h5" | undefined;
143
- asChild?: false | undefined;
144
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">) | ({
145
- id?: string | undefined;
146
- asChild?: false | undefined;
147
- } & {
148
- as?: "h6" | undefined;
149
- asChild?: false | undefined;
150
- } & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref">)) & React.RefAttributes<HTMLButtonElement>>;
151
- };
152
- type RadioGroupProps = {
153
- Root: RootProps;
154
- Item: ItemProps;
155
- Trigger: TriggerProps;
156
- Indicator: IndicatorProps;
157
- Label: LabelProps;
158
- GroupLabel: GroupLabelProps;
159
- };
160
- export { RadioGroup };
161
- export type { RadioGroupProps };
@@ -1,93 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import React__default, { useRef } from "react";
3
- import clsx from "clsx";
4
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
5
- import { Label as Label$1 } from "../label/label.js";
6
- import { useComposedRefs } from "../../utils/composeRefs.js";
7
- import { Slot } from "@radix-ui/react-slot";
8
- const styles = {
9
- "teddy-radio-group": "_teddy-radio-group_1flae_1",
10
- "teddy-radio-group__group-label": "_teddy-radio-group__group-label_1flae_10",
11
- "teddy-radio-group__label": "_teddy-radio-group__label_1flae_13",
12
- "teddy-radio-group__group-label--required": "_teddy-radio-group__group-label--required_1flae_23",
13
- "teddy-radio-group__item": "_teddy-radio-group__item_1flae_26",
14
- "teddy-radio-group__trigger": "_teddy-radio-group__trigger_1flae_54",
15
- "teddy-radio-group__indicator": "_teddy-radio-group__indicator_1flae_111"
16
- };
17
- const rootClassName = "teddy-radio-group";
18
- const RootContext = React__default.createContext(void 0);
19
- const Root = React__default.forwardRef(
20
- ({ className, ...props }, forwardRef) => {
21
- const classes = clsx([styles[`${rootClassName}`]], className);
22
- const [groupLabelId, setGroupLabelId] = React__default.useState();
23
- return /* @__PURE__ */ jsx(RootContext.Provider, { value: { setGroupLabelId, required: props.required }, children: /* @__PURE__ */ jsx(RadioGroupPrimitive.Root, { "aria-labelledby": groupLabelId, ...props, ref: forwardRef, className: classes }) });
24
- }
25
- );
26
- Root.displayName = "RadioGroup";
27
- const ItemContext = React__default.createContext(
28
- void 0
29
- );
30
- const Item = React__default.forwardRef(({ className, ...props }, forwardRef) => {
31
- const classes = clsx([styles[`${rootClassName}__item`]], className);
32
- const triggerRef = useRef(null);
33
- const triggerId = `${React__default.useId()}-trigger`;
34
- return /* @__PURE__ */ jsx(ItemContext.Provider, { value: { triggerRef, id: triggerId }, children: /* @__PURE__ */ jsx("div", { ...props, ref: forwardRef, className: classes }) });
35
- });
36
- Item.displayName = "RadioGroup.Item";
37
- const GroupLabel = React__default.forwardRef(
38
- ({ className, asChild, as: Tag = "h3", children, ...props }, forwardRef) => {
39
- const context = React__default.useContext(RootContext);
40
- const classes = clsx(
41
- [styles[`${rootClassName}__group-label`]],
42
- {
43
- [styles[`${rootClassName}__group-label--required`]]: context == null ? void 0 : context.required
44
- },
45
- className
46
- );
47
- const fallbackId = React__default.useId();
48
- const id = props.id || fallbackId;
49
- React__default.useEffect(() => {
50
- if (context) {
51
- context.setGroupLabelId(id);
52
- }
53
- }, [id, context]);
54
- return /* @__PURE__ */ jsx(Slot, { ...props, id, ref: forwardRef, className: classes, children: asChild ? children : Tag ? /* @__PURE__ */ jsx(Tag, { children }) : null });
55
- }
56
- );
57
- GroupLabel.displayName = "RadioGroup.GroupLabel";
58
- const Trigger = React__default.forwardRef(
59
- ({ className, children, ...props }, forwardRef) => {
60
- const classes = clsx([styles[`${rootClassName}__trigger`]], className);
61
- const context = React__default.useContext(ItemContext);
62
- const ref = useComposedRefs(forwardRef, context == null ? void 0 : context.triggerRef);
63
- const id = props.id || (context == null ? void 0 : context.id);
64
- return /* @__PURE__ */ jsx(RadioGroupPrimitive.Item, { ...props, id, ref, className: classes, children: children || /* @__PURE__ */ jsx(Indicator, {}) });
65
- }
66
- );
67
- Trigger.displayName = "RadioGroup.Trigger";
68
- const Indicator = React__default.forwardRef(
69
- ({ className, ...props }, forwardRef) => {
70
- const classes = clsx([styles[`${rootClassName}__indicator`]], className);
71
- return /* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { ...props, ref: forwardRef, className: classes });
72
- }
73
- );
74
- Indicator.displayName = "RadioGroup.Indicator";
75
- const Label = React__default.forwardRef(
76
- ({ className, ...props }, forwardRef) => {
77
- const classes = clsx([styles[`${rootClassName}__label`]], className);
78
- const context = React__default.useContext(ItemContext);
79
- const htmlFor = props.htmlFor || (context == null ? void 0 : context.id);
80
- return /* @__PURE__ */ jsx(Label$1, { ...props, htmlFor, ref: forwardRef, className: classes });
81
- }
82
- );
83
- Label.displayName = "RadioGroup.Label";
84
- const RadioGroup = Object.assign(Root, {
85
- Item,
86
- Trigger,
87
- Indicator,
88
- Label,
89
- GroupLabel
90
- });
91
- export {
92
- RadioGroup
93
- };
@@ -1,14 +0,0 @@
1
- const styles = {
2
- "teddy-drawer__overlay": "_teddy-drawer__overlay_uo1cy_26",
3
- "teddy-overlay-no-op": "_teddy-overlay-no-op_uo1cy_1",
4
- "teddy-fade-in": "_teddy-fade-in_uo1cy_1",
5
- "teddy-fade-out": "_teddy-fade-out_uo1cy_1",
6
- "teddy-drawer__overlay--container": "_teddy-drawer__overlay--container_uo1cy_56",
7
- "teddy-drawer__content": "_teddy-drawer__content_uo1cy_62",
8
- "drawer-content-show": "_drawer-content-show_uo1cy_1",
9
- "drawer-content-hide": "_drawer-content-hide_uo1cy_1",
10
- "teddy-drawer__close--floating": "_teddy-drawer__close--floating_uo1cy_87"
11
- };
12
- export {
13
- styles as s
14
- };
@@ -1,13 +0,0 @@
1
- "use strict";
2
- const styles = {
3
- "teddy-drawer__overlay": "_teddy-drawer__overlay_uo1cy_26",
4
- "teddy-overlay-no-op": "_teddy-overlay-no-op_uo1cy_1",
5
- "teddy-fade-in": "_teddy-fade-in_uo1cy_1",
6
- "teddy-fade-out": "_teddy-fade-out_uo1cy_1",
7
- "teddy-drawer__overlay--container": "_teddy-drawer__overlay--container_uo1cy_56",
8
- "teddy-drawer__content": "_teddy-drawer__content_uo1cy_62",
9
- "drawer-content-show": "_drawer-content-show_uo1cy_1",
10
- "drawer-content-hide": "_drawer-content-hide_uo1cy_1",
11
- "teddy-drawer__close--floating": "_teddy-drawer__close--floating_uo1cy_87"
12
- };
13
- exports.styles = styles;