@telia/teddy 0.0.6 → 0.0.9

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.
@@ -1,4 +1,4 @@
1
- import { R as a } from "../../radio-group-0Oc9WTDf.js";
1
+ import { R as a } from "../../radio-group-BR5SMJXJ.js";
2
2
  export {
3
3
  a as RadioGroup
4
4
  };
@@ -2,19 +2,73 @@ import { Label as LabelPrimitive } from '../label';
2
2
  import { default as React } from 'react';
3
3
 
4
4
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
5
- /** -------------------------------------------------------------------------------------------------
6
- * Root
7
- * -----------------------------------------------------------------------------------------------*/
8
- type RootProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> & {};
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
+ };
9
27
  /** -------------------------------------------------------------------------------------------------
10
28
  * Item
11
29
  * -----------------------------------------------------------------------------------------------*/
12
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'>;
13
65
  /** -------------------------------------------------------------------------------------------------
14
66
  * Trigger
15
67
  * -----------------------------------------------------------------------------------------------*/
16
68
  type TriggerProps = React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item> & {
17
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;
18
72
  };
19
73
  /** -------------------------------------------------------------------------------------------------
20
74
  * Indicator
@@ -27,10 +81,33 @@ type LabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive> & {
27
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. */
28
82
  htmlFor?: string;
29
83
  };
30
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>> & {
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>> & {
31
106
  Item: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
32
107
  Trigger: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
33
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;
34
111
  } & React.RefAttributes<HTMLButtonElement>>;
35
112
  Indicator: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupIndicatorProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
36
113
  Label: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-label').LabelProps & React.RefAttributes<HTMLLabelElement>, "ref"> & {
@@ -40,6 +117,37 @@ declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimiti
40
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. */
41
118
  htmlFor?: string | undefined;
42
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>>;
43
151
  };
44
152
  type RadioGroupProps = {
45
153
  Root: RootProps;
@@ -47,6 +155,7 @@ type RadioGroupProps = {
47
155
  Trigger: TriggerProps;
48
156
  Indicator: IndicatorProps;
49
157
  Label: LabelProps;
158
+ GroupLabel: GroupLabelProps;
50
159
  };
51
160
  export { RadioGroup };
52
161
  export type { RadioGroupProps };
@@ -1,9 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../clsx-DB4S2d7J.js";
4
- import { R } from "../../radio-group-0Oc9WTDf.js";
4
+ import { R as d } from "../../radio-group-BR5SMJXJ.js";
5
5
  import "../label/label.js";
6
6
  import "../../utils/composeRefs.js";
7
+ import "../../index-DpfSJps6.js";
7
8
  export {
8
- R as RadioGroup
9
+ d as RadioGroup
9
10
  };
@@ -0,0 +1,2 @@
1
+ export { Toggle } from './toggle';
2
+ export type { ToggleProps } from './toggle';
@@ -0,0 +1,4 @@
1
+ import { T as g } from "../../badge-9vHb0-Jo.js";
2
+ export {
3
+ g as Toggle
4
+ };
@@ -3,30 +3,30 @@ import { default as React } from 'react';
3
3
 
4
4
  import * as SwitchPrimitive from '@radix-ui/react-switch';
5
5
  /** -------------------------------------------------------------------------------------------------
6
- * SwitchRoot
6
+ * ToggleRoot
7
7
  * -----------------------------------------------------------------------------------------------*/
8
- type SwitchRootProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'id'> & {
9
- /** The id you want to use to connect the label to the switch. If not provided, it will be generated */
8
+ type ToggleRootProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'id'> & {
9
+ /** The id you want to use to connect the label to the toggle. If not provided, it will be generated */
10
10
  id?: string;
11
11
  };
12
12
  /** -------------------------------------------------------------------------------------------------
13
- * SwitchLabel
13
+ * ToggleLabel
14
14
  * -----------------------------------------------------------------------------------------------*/
15
- type SwitchLabelProps = Omit<React.ComponentPropsWithoutRef<typeof Label>, 'id'>;
15
+ type ToggleLabelProps = Omit<React.ComponentPropsWithoutRef<typeof Label>, 'id'>;
16
16
  /** -------------------------------------------------------------------------------------------------
17
- * SwitchInput
17
+ * ToggleInput
18
18
  * -----------------------------------------------------------------------------------------------*/
19
- type SwitchInputProps = Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'id'>;
19
+ type ToggleInputProps = Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Root>, 'id'>;
20
20
  /** -------------------------------------------------------------------------------------------------
21
- * SwitchThumb
21
+ * ToggleThumb
22
22
  * -----------------------------------------------------------------------------------------------*/
23
- type SwitchThumbProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Thumb>;
24
- declare const Switch: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "id"> & {
25
- /** The id you want to use to connect the label to the switch. If not provided, it will be generated */
23
+ type ToggleThumbProps = React.ComponentPropsWithoutRef<typeof SwitchPrimitive.Thumb>;
24
+ declare const Toggle: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">, "id"> & {
25
+ /** The id you want to use to connect the label to the toggle. If not provided, it will be generated */
26
26
  id?: string | undefined;
27
27
  } & React.RefAttributes<HTMLDivElement>> & {
28
- Label: React.ForwardRefExoticComponent<SwitchLabelProps & React.RefAttributes<HTMLLabelElement>>;
29
- Input: React.ForwardRefExoticComponent<SwitchInputProps & React.RefAttributes<HTMLButtonElement>>;
28
+ Label: React.ForwardRefExoticComponent<ToggleLabelProps & React.RefAttributes<HTMLLabelElement>>;
29
+ Input: React.ForwardRefExoticComponent<ToggleInputProps & React.RefAttributes<HTMLButtonElement>>;
30
30
  Thumb: React.ForwardRefExoticComponent<Omit<SwitchPrimitive.SwitchThumbProps & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<HTMLSpanElement>>;
31
31
  Indicator: React.ForwardRefExoticComponent<Partial<Omit<React.SVGProps<SVGSVGElement> & {
32
32
  name: "link" | "map" | "menu" | "search" | "summary" | "time" | "video" | "filter" | "image" | "stop" | "key" | "x" | "download" | "split" | "alert" | "radio" | "email" | "copy" | "reverse" | "add" | "infinite" | "visible" | "help" | "zoom-out" | "zoom" | "sync" | "close" | "error" | "focus" | "play" | "alarm-off" | "alarm-on" | "attachment" | "bookmark-filled" | "bookmark" | "copy-filled" | "dislike" | "edit" | "heart-filled" | "heart" | "invisible" | "like" | "lock-open" | "lock" | "login" | "logout" | "maximize" | "minimize" | "mute" | "password-invisible" | "password-visible" | "play-filled" | "remove-filled" | "remove" | "save" | "send" | "settings" | "share" | "shuffle" | "skip-back-10sec" | "skip-back-30sec" | "skip-forward-10sec" | "skip-forward-30sec" | "star-filled" | "star" | "switch-arrows" | "tv-next" | "tv-pause" | "tv-previous" | "tv-stop" | "upload" | "volume" | "connected-building" | "home" | "hospital" | "industry" | "premises-datacenter" | "premises-large" | "premises-medium" | "premises-small" | "premises" | "store" | "address-book" | "b2b-customer" | "care" | "chat-robot" | "chat" | "child-1" | "child-2" | "conversation" | "customer-dialogue" | "dsl-hub" | "end-user" | "handshake" | "headphones" | "letter" | "mms" | "new-contact" | "new-group" | "news" | "parental-guide" | "people-hub" | "people" | "portal" | "signature" | "smiley-happy" | "smiley-sad" | "sms" | "support" | "user-admin" | "vcard" | "voicemail" | "battery" | "bluetooth" | "broadband" | "broken-phone" | "cast" | "cloud-connect" | "connected" | "core-router" | "daas-device" | "data-transfer" | "desktop" | "devices" | "esim-simcard" | "esim" | "face-id" | "fiber" | "fingerprint" | "fiveg" | "fourg" | "home-installation" | "industrial-iot" | "internet" | "it-service" | "laptop" | "mobile-broadband" | "network" | "phone-recycling" | "phone-ringing" | "phone" | "rack" | "refill-card" | "remote-control" | "repair" | "roaming" | "router" | "secure-device" | "sense-car" | "server" | "service-device" | "service-supervision" | "slow-wifi" | "smart-wifi" | "smartphone" | "smartwatch" | "tablet" | "trade-phone" | "tv" | "usb" | "voice-switch" | "wallplug" | "wireless-off" | "wireless-weak" | "wireless" | "world-alert" | "world-off" | "world-question" | "bar-chart" | "doc" | "document-doc" | "document-edit" | "document-pdf" | "document-ppt" | "excel" | "folder-copy" | "folder-new" | "folder" | "gif" | "graph" | "media-content" | "org-chart" | "pie-chart" | "print" | "register" | "report" | "simcard" | "spell-check" | "credit-card" | "euro" | "invoice" | "kontantkort" | "kr" | "late-payment" | "money-back-euro" | "money-back-kr" | "money-euro" | "money-kr" | "pay-monthly-euro" | "pay-monthly-kr" | "pay-once-euro" | "pay-once-kr" | "payment-success" | "savings" | "wallet" | "airplay" | "camera" | "entertainment" | "external" | "film" | "games" | "megaphone" | "microphone" | "music" | "player-settings" | "record" | "stream" | "trailer" | "video-conference" | "activity-level" | "ai-robot" | "bag" | "basketball" | "blood-pressure" | "bulb" | "business-continuity" | "business-intelligence" | "calendar" | "cart" | "close-circle" | "cloud" | "coffee" | "compass" | "construction" | "cookie" | "delivery" | "drone" | "education" | "efficiency" | "environment" | "facemask" | "flag" | "food" | "fraud" | "getting-started" | "home-care" | "job-search" | "layers" | "measuring-health" | "moisture" | "offering" | "offshore" | "optimization" | "pebble" | "pet-dog" | "pin" | "plane" | "plus-minus" | "police" | "power-grid" | "present" | "press-button" | "price" | "pulse" | "recycle" | "reservation" | "route" | "ruler" | "satellite" | "secured-1" | "secured-2" | "security-camera" | "shopping" | "snowflake" | "speedometer" | "spyware" | "suitcase" | "sustainability" | "tag" | "temperature" | "thinking" | "train" | "transfer" | "undo" | "wavelength" | "weather" | "world" | "android" | "apple" | "bankid" | "facebook" | "instagram" | "linkedin" | "snapchat" | "whatsapp" | "windows" | "youtube" | "alert-filled" | "check-circle-filled" | "check-circle" | "error-filled" | "info-filled" | "info" | "question-filled" | "question" | "warning" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-subdirectory" | "arrow-up" | "card-view" | "checkmark-bold" | "checkmark" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "grid-view" | "list-view" | "minus-bold" | "minus" | "more-horizontal" | "more-vertical" | "plus" | "services" | "sorter" | "table-view";
@@ -34,11 +34,11 @@ declare const Switch: React.ForwardRefExoticComponent<Omit<Omit<React.DetailedHT
34
34
  children?: React.ReactNode;
35
35
  }, "ref">> & React.RefAttributes<SVGSVGElement>>;
36
36
  };
37
- type SwitchProps = {
38
- Root: SwitchRootProps;
39
- Label: SwitchLabelProps;
40
- Input: SwitchInputProps;
41
- Thumb: SwitchThumbProps;
37
+ type ToggleProps = {
38
+ Root: ToggleRootProps;
39
+ Label: ToggleLabelProps;
40
+ Input: ToggleInputProps;
41
+ Thumb: ToggleThumbProps;
42
42
  };
43
- export { Switch };
44
- export type { SwitchProps };
43
+ export { Toggle };
44
+ export type { ToggleProps };
@@ -1,10 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "react";
3
3
  import "../../clsx-DB4S2d7J.js";
4
- import { S as v } from "../../badge-tBBi5HpV.js";
4
+ import { T as w } from "../../badge-9vHb0-Jo.js";
5
5
  import "../../assets/5161b177f001ea1a.svg";
6
6
  import "../icon/icon.js";
7
- import "../../radio-group-0Oc9WTDf.js";
7
+ import "../../radio-group-BR5SMJXJ.js";
8
8
  import "../box/box.js";
9
9
  import "../flex/flex.js";
10
10
  import "../grid/grid.js";
@@ -22,5 +22,5 @@ import "../heading/heading.js";
22
22
  import "../visually-hidden/visually-hidden.js";
23
23
  import "../text-spacing/text-spacing.js";
24
24
  export {
25
- v as Switch
25
+ w as Toggle
26
26
  };
package/dist/main.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import './assets/main.css';
2
- import { R as e } from "./radio-group-0Oc9WTDf.js";
2
+ import { R as e } from "./radio-group-BR5SMJXJ.js";
3
3
  import { Box as p } from "./components/box/box.js";
4
4
  import { Flex as f } from "./components/flex/flex.js";
5
- import { A as a, B as i, C as n, S as s } from "./badge-tBBi5HpV.js";
5
+ import { A as a, B as i, C as n, T as s } from "./badge-9vHb0-Jo.js";
6
6
  import { Grid as l } from "./components/grid/grid.js";
7
7
  import { NavigationMenu as u } from "./components/navigation-menu/navigation-menu.js";
8
- import { Link as g } from "./components/link/link.js";
8
+ import { Link as c } from "./components/link/link.js";
9
9
  import { Button as B } from "./components/button/button.js";
10
- import { FieldErrorText as S } from "./components/field-error-text/field-error-text.js";
11
- import { HelperText as h } from "./components/helper-text/helper-text.js";
12
- import { default as F } from "./assets/5161b177f001ea1a.svg";
13
- import { Icon as I } from "./components/icon/icon.js";
14
- import { Input as w, InputGroup as A } from "./components/input/input.js";
15
- import { Label as L } from "./components/label/label.js";
10
+ import { FieldErrorText as b } from "./components/field-error-text/field-error-text.js";
11
+ import { HelperText as F } from "./components/helper-text/helper-text.js";
12
+ import { default as I } from "./assets/5161b177f001ea1a.svg";
13
+ import { Icon as k } from "./components/icon/icon.js";
14
+ import { Input as C, InputGroup as L } from "./components/input/input.js";
15
+ import { Label as S } from "./components/label/label.js";
16
16
  import { Spinner as E } from "./components/spinner/spinner.js";
17
17
  import { Text as N } from "./components/text/text.js";
18
18
  import { TextField as j } from "./components/text-field/text-field.js";
@@ -32,28 +32,28 @@ export {
32
32
  p as Box,
33
33
  B as Button,
34
34
  n as Card,
35
- S as FieldErrorText,
35
+ b as FieldErrorText,
36
36
  f as Flex,
37
37
  l as Grid,
38
38
  z as Heading,
39
- h as HelperText,
40
- I as Icon,
41
- w as Input,
42
- A as InputGroup,
43
- L as Label,
44
- g as Link,
39
+ F as HelperText,
40
+ k as Icon,
41
+ C as Input,
42
+ L as InputGroup,
43
+ S as Label,
44
+ c as Link,
45
45
  u as NavigationMenu,
46
46
  e as RadioGroup,
47
47
  E as Spinner,
48
- s as Switch,
49
48
  N as Text,
50
49
  j as TextField,
51
50
  O as TextSpacing,
51
+ s as Toggle,
52
52
  J as VisuallyHidden,
53
53
  Q as border,
54
54
  W as breakpoint,
55
55
  Y as color,
56
- F as iconsHref,
56
+ I as iconsHref,
57
57
  _ as motion,
58
58
  oo as shadow,
59
59
  eo as spacing,