@arkyn/components 3.0.1-beta.143 → 3.0.1-beta.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/alert/alertContainer/index.d.ts +27 -43
- package/dist/components/alert/alertContainer/index.d.ts.map +1 -1
- package/dist/components/alert/alertContainer/index.js +20 -40
- package/dist/components/alert/alertContent/index.d.ts +11 -36
- package/dist/components/alert/alertContent/index.d.ts.map +1 -1
- package/dist/components/alert/alertContent/index.js +11 -31
- package/dist/components/alert/alertDescription/index.d.ts +10 -38
- package/dist/components/alert/alertDescription/index.d.ts.map +1 -1
- package/dist/components/alert/alertDescription/index.js +10 -33
- package/dist/components/alert/alertIcon/index.d.ts +14 -38
- package/dist/components/alert/alertIcon/index.d.ts.map +1 -1
- package/dist/components/alert/alertIcon/index.js +14 -32
- package/dist/components/alert/alertTitle/index.d.ts +12 -35
- package/dist/components/alert/alertTitle/index.d.ts.map +1 -1
- package/dist/components/alert/alertTitle/index.js +12 -27
- package/dist/components/audioPlayer/index.d.ts +24 -32
- package/dist/components/audioPlayer/index.d.ts.map +1 -1
- package/dist/components/audioPlayer/index.js +15 -18
- package/dist/components/audioUpload/index.d.ts +37 -48
- package/dist/components/audioUpload/index.d.ts.map +1 -1
- package/dist/components/audioUpload/index.js +23 -48
- package/dist/components/badge/index.d.ts +31 -22
- package/dist/components/badge/index.d.ts.map +1 -1
- package/dist/components/badge/index.js +14 -22
- package/dist/components/button/index.d.ts +38 -28
- package/dist/components/button/index.d.ts.map +1 -1
- package/dist/components/button/index.js +18 -28
- package/dist/components/cardTab/cardTabButton/index.d.ts +14 -52
- package/dist/components/cardTab/cardTabButton/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabButton/index.js +12 -52
- package/dist/components/cardTab/cardTabContainer/index.d.ts +16 -58
- package/dist/components/cardTab/cardTabContainer/index.d.ts.map +1 -1
- package/dist/components/cardTab/cardTabContainer/index.js +12 -58
- package/dist/components/checkbox/index.d.ts +38 -37
- package/dist/components/checkbox/index.d.ts.map +1 -1
- package/dist/components/checkbox/index.js +21 -37
- package/dist/components/clientOnly.d.ts +13 -66
- package/dist/components/clientOnly.d.ts.map +1 -1
- package/dist/components/clientOnly.js +11 -66
- package/dist/components/currencyInput/index.d.ts +67 -50
- package/dist/components/currencyInput/index.d.ts.map +1 -1
- package/dist/components/currencyInput/index.js +28 -50
- package/dist/components/divider/index.d.ts +12 -25
- package/dist/components/divider/index.d.ts.map +1 -1
- package/dist/components/divider/index.js +8 -25
- package/dist/components/drawer/drawerContainer/index.d.ts +16 -50
- package/dist/components/drawer/drawerContainer/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerContainer/index.js +13 -50
- package/dist/components/drawer/drawerHeader/index.d.ts +9 -33
- package/dist/components/drawer/drawerHeader/index.d.ts.map +1 -1
- package/dist/components/drawer/drawerHeader/index.js +8 -33
- package/dist/components/facebookPixel/index.d.ts +47 -0
- package/dist/components/facebookPixel/index.d.ts.map +1 -1
- package/dist/components/facebookPixel/index.js +35 -0
- package/dist/components/fieldError/index.d.ts +4 -11
- package/dist/components/fieldError/index.d.ts.map +1 -1
- package/dist/components/fieldError/index.js +4 -11
- package/dist/components/fieldLabel/index.d.ts +6 -21
- package/dist/components/fieldLabel/index.d.ts.map +1 -1
- package/dist/components/fieldLabel/index.js +5 -21
- package/dist/components/fieldWrapper/index.d.ts +12 -22
- package/dist/components/fieldWrapper/index.d.ts.map +1 -1
- package/dist/components/fieldWrapper/index.js +7 -22
- package/dist/components/fileUpload/index.d.ts +36 -61
- package/dist/components/fileUpload/index.d.ts.map +1 -1
- package/dist/components/fileUpload/index.js +23 -61
- package/dist/components/googleAnalytics/index.d.ts +11 -7
- package/dist/components/googleAnalytics/index.d.ts.map +1 -1
- package/dist/components/googleAnalytics/index.js +9 -7
- package/dist/components/googleTagManager/index.d.ts +27 -21
- package/dist/components/googleTagManager/index.d.ts.map +1 -1
- package/dist/components/googleTagManager/index.js +20 -21
- package/dist/components/iconButton/index.d.ts +31 -15
- package/dist/components/iconButton/index.d.ts.map +1 -1
- package/dist/components/iconButton/index.js +12 -15
- package/dist/components/imageUpload/index.d.ts +47 -75
- package/dist/components/imageUpload/index.d.ts.map +1 -1
- package/dist/components/imageUpload/index.js +27 -75
- package/dist/components/input/index.d.ts +51 -44
- package/dist/components/input/index.d.ts.map +1 -1
- package/dist/components/input/index.js +24 -44
- package/dist/components/mapView/index.d.ts +44 -0
- package/dist/components/mapView/index.d.ts.map +1 -1
- package/dist/components/mapView/index.js +35 -0
- package/dist/components/maskedInput/index.d.ts +66 -51
- package/dist/components/maskedInput/index.d.ts.map +1 -1
- package/dist/components/maskedInput/index.js +28 -51
- package/dist/components/modal/modalContainer/index.d.ts +17 -57
- package/dist/components/modal/modalContainer/index.d.ts.map +1 -1
- package/dist/components/modal/modalContainer/index.js +15 -57
- package/dist/components/modal/modalFooter/index.d.ts +17 -50
- package/dist/components/modal/modalFooter/index.d.ts.map +1 -1
- package/dist/components/modal/modalFooter/index.js +10 -50
- package/dist/components/modal/modalHeader/index.d.ts +13 -47
- package/dist/components/modal/modalHeader/index.d.ts.map +1 -1
- package/dist/components/modal/modalHeader/index.js +12 -47
- package/dist/components/multiSelect/index.d.ts +67 -62
- package/dist/components/multiSelect/index.d.ts.map +1 -1
- package/dist/components/multiSelect/index.js +28 -62
- package/dist/components/pagination/index.d.ts +18 -9
- package/dist/components/pagination/index.d.ts.map +1 -1
- package/dist/components/pagination/index.js +18 -9
- package/dist/components/phoneInput/index.d.ts +65 -30
- package/dist/components/phoneInput/index.d.ts.map +1 -1
- package/dist/components/phoneInput/index.js +35 -30
- package/dist/components/popover/index.d.ts +34 -114
- package/dist/components/popover/index.d.ts.map +1 -1
- package/dist/components/popover/index.js +25 -114
- package/dist/components/radio/radioBox/index.d.ts +17 -65
- package/dist/components/radio/radioBox/index.d.ts.map +1 -1
- package/dist/components/radio/radioBox/index.js +14 -65
- package/dist/components/radio/radioGroup/index.d.ts +36 -67
- package/dist/components/radio/radioGroup/index.d.ts.map +1 -1
- package/dist/components/radio/radioGroup/index.js +25 -67
- package/dist/components/richText/index.d.ts +33 -47
- package/dist/components/richText/index.d.ts.map +1 -1
- package/dist/components/richText/index.js +30 -44
- package/dist/components/searchPlaces.d.ts +52 -50
- package/dist/components/searchPlaces.d.ts.map +1 -1
- package/dist/components/searchPlaces.js +23 -30
- package/dist/components/select/index.d.ts +68 -63
- package/dist/components/select/index.d.ts.map +1 -1
- package/dist/components/select/index.js +29 -63
- package/dist/components/slider/index.d.ts +20 -34
- package/dist/components/slider/index.d.ts.map +1 -1
- package/dist/components/slider/index.js +15 -33
- package/dist/components/switch/index.d.ts +42 -58
- package/dist/components/switch/index.d.ts.map +1 -1
- package/dist/components/switch/index.js +24 -58
- package/dist/components/tab/tabButton/index.d.ts +14 -52
- package/dist/components/tab/tabButton/index.d.ts.map +1 -1
- package/dist/components/tab/tabButton/index.js +12 -52
- package/dist/components/tab/tabContainer/index.d.ts +16 -58
- package/dist/components/tab/tabContainer/index.d.ts.map +1 -1
- package/dist/components/tab/tabContainer/index.js +12 -58
- package/dist/components/table/tableBody/index.d.ts +13 -47
- package/dist/components/table/tableBody/index.d.ts.map +1 -1
- package/dist/components/table/tableBody/index.js +12 -47
- package/dist/components/table/tableCaption/index.d.ts +6 -46
- package/dist/components/table/tableCaption/index.d.ts.map +1 -1
- package/dist/components/table/tableCaption/index.js +6 -46
- package/dist/components/table/tableContainer/index.d.ts +12 -41
- package/dist/components/table/tableContainer/index.d.ts.map +1 -1
- package/dist/components/table/tableContainer/index.js +12 -41
- package/dist/components/table/tableFooter/index.d.ts +5 -29
- package/dist/components/table/tableFooter/index.d.ts.map +1 -1
- package/dist/components/table/tableFooter/index.js +5 -29
- package/dist/components/table/tableHeader/index.d.ts +4 -25
- package/dist/components/table/tableHeader/index.d.ts.map +1 -1
- package/dist/components/table/tableHeader/index.js +4 -25
- package/dist/components/textarea/index.d.ts +32 -64
- package/dist/components/textarea/index.d.ts.map +1 -1
- package/dist/components/textarea/index.js +16 -64
- package/dist/components/tooltip/index.d.ts +27 -55
- package/dist/components/tooltip/index.d.ts.map +1 -1
- package/dist/components/tooltip/index.js +16 -55
- package/dist/hooks/useAutomation.d.ts +18 -26
- package/dist/hooks/useAutomation.d.ts.map +1 -1
- package/dist/hooks/useAutomation.js +18 -26
- package/dist/hooks/useDrawer.d.ts +19 -64
- package/dist/hooks/useDrawer.d.ts.map +1 -1
- package/dist/hooks/useForm.d.ts +12 -29
- package/dist/hooks/useForm.d.ts.map +1 -1
- package/dist/hooks/useForm.js +12 -29
- package/dist/hooks/useHydrated.d.ts +8 -63
- package/dist/hooks/useHydrated.d.ts.map +1 -1
- package/dist/hooks/useHydrated.js +8 -63
- package/dist/hooks/useModal.d.ts +19 -59
- package/dist/hooks/useModal.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.d.ts +17 -69
- package/dist/hooks/useScopedParams.d.ts.map +1 -1
- package/dist/hooks/useScopedParams.js +17 -69
- package/dist/hooks/useScrollLock.d.ts +11 -27
- package/dist/hooks/useScrollLock.d.ts.map +1 -1
- package/dist/hooks/useScrollLock.js +11 -33
- package/dist/hooks/useSearchAutomation.d.ts +16 -34
- package/dist/hooks/useSearchAutomation.d.ts.map +1 -1
- package/dist/hooks/useSearchAutomation.js +16 -34
- package/dist/hooks/useSlider.d.ts +5 -19
- package/dist/hooks/useSlider.d.ts.map +1 -1
- package/dist/hooks/useSlider.js +5 -19
- package/dist/hooks/useToast.d.ts +8 -52
- package/dist/hooks/useToast.d.ts.map +1 -1
- package/dist/hooks/useToast.js +8 -52
- package/dist/providers/drawerProvider.d.ts +15 -81
- package/dist/providers/drawerProvider.d.ts.map +1 -1
- package/dist/providers/drawerProvider.js +15 -81
- package/dist/providers/formProvider.d.ts +17 -53
- package/dist/providers/formProvider.d.ts.map +1 -1
- package/dist/providers/formProvider.js +17 -53
- package/dist/providers/modalProvider.d.ts +16 -77
- package/dist/providers/modalProvider.d.ts.map +1 -1
- package/dist/providers/modalProvider.js +16 -77
- package/dist/providers/placesProvider.d.ts +16 -11
- package/dist/providers/placesProvider.d.ts.map +1 -1
- package/dist/providers/placesProvider.js +16 -11
- package/dist/providers/toastProvider.d.ts +10 -21
- package/dist/providers/toastProvider.d.ts.map +1 -1
- package/dist/providers/toastProvider.js +10 -21
- package/dist/services/toHtml.d.ts +11 -10
- package/dist/services/toHtml.d.ts.map +1 -1
- package/dist/services/toHtml.js +11 -10
- package/dist/services/toRichTextValue.d.ts +11 -17
- package/dist/services/toRichTextValue.d.ts.map +1 -1
- package/dist/services/toRichTextValue.js +11 -17
- package/package.json +1 -1
|
@@ -1,55 +1,41 @@
|
|
|
1
1
|
import { HTMLAttributes } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type SliderProps = Omit<HTMLAttributes<HTMLDivElement>, "onChange"> & {
|
|
4
|
+
/** Current slider position as a percentage (0–100). Required. */
|
|
4
5
|
value: number;
|
|
6
|
+
/** Callback fired whenever the value changes. Required. */
|
|
5
7
|
onChange: (value: number) => void;
|
|
8
|
+
/** Disables all drag and click interactions. @default false */
|
|
6
9
|
disabled?: boolean;
|
|
7
|
-
|
|
10
|
+
/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */
|
|
11
|
+
onDragging?: (isDragging: boolean) => void;
|
|
8
12
|
};
|
|
9
13
|
/**
|
|
10
|
-
* Slider
|
|
14
|
+
* Slider — interactive track for selecting a numeric value between 0 and 100.
|
|
11
15
|
*
|
|
12
|
-
*
|
|
13
|
-
* @param props.value - Current slider value (0-100)
|
|
14
|
-
* @param props.onChange - Callback function called when value changes
|
|
15
|
-
* @param props.disabled - Disables slider interaction. Default: false
|
|
16
|
-
* @param props.onDragging - Callback function called when dragging state changes
|
|
16
|
+
* Pair with `useSlider` for managed state.
|
|
17
17
|
*
|
|
18
|
-
*
|
|
18
|
+
* @param props.value - Current position as a percentage (0–100). Required.
|
|
19
|
+
* @param props.onChange - Callback fired on value change. Required.
|
|
20
|
+
* @param props.disabled - Disables interactions. Default: false
|
|
21
|
+
* @param props.onDragging - Callback fired when dragging starts or stops.
|
|
19
22
|
*
|
|
20
|
-
*
|
|
23
|
+
* **...Other valid HTML properties for `<div>`**
|
|
24
|
+
*
|
|
25
|
+
* @returns Slider JSX element.
|
|
21
26
|
*
|
|
22
27
|
* @example
|
|
23
28
|
* ```tsx
|
|
24
|
-
* //
|
|
29
|
+
* // Controlled slider
|
|
25
30
|
* const [value, setValue] = useState(50);
|
|
26
31
|
* <Slider value={value} onChange={setValue} />
|
|
27
32
|
*
|
|
28
|
-
* //
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* // Slider with dragging callback
|
|
32
|
-
* const [isDragging, setIsDragging] = useState(false);
|
|
33
|
-
* <Slider
|
|
34
|
-
* value={value}
|
|
35
|
-
* onChange={setValue}
|
|
36
|
-
* onDragging={setIsDragging}
|
|
37
|
-
* />
|
|
33
|
+
* // With useSlider hook
|
|
34
|
+
* const [value, setValue] = useSlider(25);
|
|
35
|
+
* <Slider value={value} onChange={setValue} onDragging={setIsDragging} />
|
|
38
36
|
*
|
|
39
|
-
* //
|
|
40
|
-
*
|
|
41
|
-
* const [sliderValue, setSliderValue] = useSlider(25);
|
|
42
|
-
* const [isDragging, setIsDragging] = useState(false);
|
|
43
|
-
*
|
|
44
|
-
* return (
|
|
45
|
-
* <Slider
|
|
46
|
-
* value={sliderValue}
|
|
47
|
-
* onChange={setSliderValue}
|
|
48
|
-
* onDragging={setIsDragging}
|
|
49
|
-
* className="custom-slider"
|
|
50
|
-
* />
|
|
51
|
-
* );
|
|
52
|
-
* }
|
|
37
|
+
* // Disabled
|
|
38
|
+
* <Slider value={75} onChange={() => {}} disabled />
|
|
53
39
|
* ```
|
|
54
40
|
*/
|
|
55
41
|
declare function Slider(props: SliderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAEpE,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/slider/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA+B,MAAM,OAAO,CAAC;AAEpE,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,GAAG;IACpE,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oGAAoG;IACpG,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CAuEjC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -2,49 +2,31 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
/**
|
|
5
|
-
* Slider
|
|
5
|
+
* Slider — interactive track for selecting a numeric value between 0 and 100.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
* @param props.value - Current slider value (0-100)
|
|
9
|
-
* @param props.onChange - Callback function called when value changes
|
|
10
|
-
* @param props.disabled - Disables slider interaction. Default: false
|
|
11
|
-
* @param props.onDragging - Callback function called when dragging state changes
|
|
7
|
+
* Pair with `useSlider` for managed state.
|
|
12
8
|
*
|
|
13
|
-
*
|
|
9
|
+
* @param props.value - Current position as a percentage (0–100). Required.
|
|
10
|
+
* @param props.onChange - Callback fired on value change. Required.
|
|
11
|
+
* @param props.disabled - Disables interactions. Default: false
|
|
12
|
+
* @param props.onDragging - Callback fired when dragging starts or stops.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
14
|
+
* **...Other valid HTML properties for `<div>`**
|
|
15
|
+
*
|
|
16
|
+
* @returns Slider JSX element.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```tsx
|
|
19
|
-
* //
|
|
20
|
+
* // Controlled slider
|
|
20
21
|
* const [value, setValue] = useState(50);
|
|
21
22
|
* <Slider value={value} onChange={setValue} />
|
|
22
23
|
*
|
|
23
|
-
* //
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* // Slider with dragging callback
|
|
27
|
-
* const [isDragging, setIsDragging] = useState(false);
|
|
28
|
-
* <Slider
|
|
29
|
-
* value={value}
|
|
30
|
-
* onChange={setValue}
|
|
31
|
-
* onDragging={setIsDragging}
|
|
32
|
-
* />
|
|
24
|
+
* // With useSlider hook
|
|
25
|
+
* const [value, setValue] = useSlider(25);
|
|
26
|
+
* <Slider value={value} onChange={setValue} onDragging={setIsDragging} />
|
|
33
27
|
*
|
|
34
|
-
* //
|
|
35
|
-
*
|
|
36
|
-
* const [sliderValue, setSliderValue] = useSlider(25);
|
|
37
|
-
* const [isDragging, setIsDragging] = useState(false);
|
|
38
|
-
*
|
|
39
|
-
* return (
|
|
40
|
-
* <Slider
|
|
41
|
-
* value={sliderValue}
|
|
42
|
-
* onChange={setSliderValue}
|
|
43
|
-
* onDragging={setIsDragging}
|
|
44
|
-
* className="custom-slider"
|
|
45
|
-
* />
|
|
46
|
-
* );
|
|
47
|
-
* }
|
|
28
|
+
* // Disabled
|
|
29
|
+
* <Slider value={75} onChange={() => {}} disabled />
|
|
48
30
|
* ```
|
|
49
31
|
*/
|
|
50
32
|
function Slider(props) {
|
|
@@ -1,98 +1,82 @@
|
|
|
1
1
|
import type { ButtonHTMLAttributes } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type SwitchProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onChange" | "defaultValue" | "onCheck" | "value"> & {
|
|
4
|
+
/** Optional label text displayed beside the switch. */
|
|
4
5
|
label?: string;
|
|
6
|
+
/**
|
|
7
|
+
* Switch size.
|
|
8
|
+
* @default "lg"
|
|
9
|
+
*/
|
|
5
10
|
size?: "sm" | "md" | "lg";
|
|
11
|
+
/** Uncontrolled initial checked state. @default false */
|
|
6
12
|
defaultChecked?: boolean;
|
|
13
|
+
/** Controlled checked state. */
|
|
7
14
|
checked?: boolean;
|
|
15
|
+
/** Value emitted when the switch is on. @default "checked" */
|
|
8
16
|
value?: string;
|
|
17
|
+
/** Value emitted when the switch is off. @default "" */
|
|
9
18
|
unCheckedValue?: string;
|
|
19
|
+
/** Field name for form submission. Required. */
|
|
10
20
|
name: string;
|
|
21
|
+
/** Callback fired on toggle — receives the current value string. */
|
|
11
22
|
onCheck?: (value: string) => void;
|
|
23
|
+
/**
|
|
24
|
+
* Layout direction forwarded to `FieldTemplate`.
|
|
25
|
+
* @default "horizontalReverse"
|
|
26
|
+
*/
|
|
12
27
|
orientation?: "vertical" | "horizontal" | "horizontalReverse";
|
|
28
|
+
/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */
|
|
13
29
|
unShowFieldTemplate?: boolean;
|
|
30
|
+
/** Displays an asterisk on the label to signal a required field. */
|
|
14
31
|
showAsterisk?: boolean;
|
|
32
|
+
/** Validation error message displayed below the switch. */
|
|
15
33
|
errorMessage?: string;
|
|
16
34
|
};
|
|
17
35
|
/**
|
|
18
|
-
* Switch
|
|
36
|
+
* Switch — toggle input for binary on/off states.
|
|
19
37
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param props.label - Optional label text to display next to the switch
|
|
23
|
-
* @param props.size - Size variant of the switch. Default: "lg"
|
|
24
|
-
* @param props.defaultChecked - Default checked state for uncontrolled usage. Default: false
|
|
25
|
-
* @param props.checked - Controlled checked state of the switch
|
|
26
|
-
* @param props.value - Value to be used when switch is checked. Default: "checked"
|
|
27
|
-
* @param props.unCheckedValue - Value to be used when switch is unchecked. Default: ""
|
|
28
|
-
* @param props.onCheck - Callback function called when switch state changes, receives the current value
|
|
29
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
30
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
38
|
+
* Stores value in a hidden `<input>` for native form submission.
|
|
39
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
31
40
|
*
|
|
32
|
-
*
|
|
41
|
+
* @param props.name - Field name for form submission. Required.
|
|
42
|
+
* @param props.label - Label text displayed beside the switch.
|
|
43
|
+
* @param props.size - Switch size (`sm` | `md` | `lg`). Default: "lg"
|
|
44
|
+
* @param props.defaultChecked - Uncontrolled initial checked state. Default: false
|
|
45
|
+
* @param props.checked - Controlled checked state.
|
|
46
|
+
* @param props.value - Value emitted when on. Default: "checked"
|
|
47
|
+
* @param props.unCheckedValue - Value emitted when off. Default: ""
|
|
48
|
+
* @param props.onCheck - Callback fired on toggle — receives the current value string.
|
|
49
|
+
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontalReverse"
|
|
50
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
51
|
+
* @param props.showAsterisk - Appends `*` to the label.
|
|
52
|
+
* @param props.errorMessage - Validation error message.
|
|
33
53
|
*
|
|
34
|
-
*
|
|
54
|
+
* **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**
|
|
55
|
+
*
|
|
56
|
+
* @returns Switch JSX element wrapped in `FieldTemplate`.
|
|
35
57
|
*
|
|
36
58
|
* @example
|
|
37
59
|
* ```tsx
|
|
38
|
-
* // Basic
|
|
60
|
+
* // Basic
|
|
39
61
|
* <Switch name="notifications" label="Enable notifications" />
|
|
40
62
|
*
|
|
41
|
-
* //
|
|
63
|
+
* // Custom on/off values
|
|
42
64
|
* <Switch
|
|
43
65
|
* name="theme"
|
|
44
66
|
* label="Dark mode"
|
|
45
67
|
* value="dark"
|
|
46
68
|
* unCheckedValue="light"
|
|
47
|
-
* onCheck={(
|
|
69
|
+
* onCheck={(v) => setTheme(v)}
|
|
48
70
|
* />
|
|
49
71
|
*
|
|
50
|
-
* // Controlled
|
|
72
|
+
* // Controlled
|
|
51
73
|
* <Switch
|
|
52
74
|
* name="autoSave"
|
|
53
|
-
* label="Auto-save
|
|
75
|
+
* label="Auto-save"
|
|
54
76
|
* checked={isAutoSaveEnabled}
|
|
55
|
-
* onCheck={(
|
|
77
|
+
* onCheck={(v) => setAutoSave(!!v)}
|
|
56
78
|
* size="md"
|
|
57
79
|
* />
|
|
58
|
-
*
|
|
59
|
-
* // Small switch with default checked state
|
|
60
|
-
* <Switch
|
|
61
|
-
* name="marketing"
|
|
62
|
-
* label="Marketing emails"
|
|
63
|
-
* size="sm"
|
|
64
|
-
* defaultChecked={true}
|
|
65
|
-
* value="subscribed"
|
|
66
|
-
* unCheckedValue="unsubscribed"
|
|
67
|
-
* />
|
|
68
|
-
*
|
|
69
|
-
* // Switch with custom styling and disabled state
|
|
70
|
-
* <Switch
|
|
71
|
-
* name="premium"
|
|
72
|
-
* label="Premium features"
|
|
73
|
-
* className="premium-switch"
|
|
74
|
-
* disabled={!isPremiumUser}
|
|
75
|
-
* onCheck={(value) => handlePremiumToggle(value)}
|
|
76
|
-
* />
|
|
77
|
-
*
|
|
78
|
-
* // Large switch for accessibility
|
|
79
|
-
* <Switch
|
|
80
|
-
* name="accessibility"
|
|
81
|
-
* label="High contrast mode"
|
|
82
|
-
* size="lg"
|
|
83
|
-
* checked={isHighContrast}
|
|
84
|
-
* onCheck={(value) => setIsHighContrast(!!value)}
|
|
85
|
-
* value="enabled"
|
|
86
|
-
* unCheckedValue="disabled"
|
|
87
|
-
* />
|
|
88
|
-
*
|
|
89
|
-
* // Switch without label for inline usage
|
|
90
|
-
* <Switch
|
|
91
|
-
* name="inline_toggle"
|
|
92
|
-
* value="on"
|
|
93
|
-
* unCheckedValue="off"
|
|
94
|
-
* onCheck={(value) => console.log('Toggle state:', value)}
|
|
95
|
-
* />
|
|
96
80
|
* ```
|
|
97
81
|
*/
|
|
98
82
|
declare function Switch(props: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CACrB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAC/D,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAAC;IAC9D,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/switch/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAIlD,OAAO,cAAc,CAAC;AAEtB,KAAK,WAAW,GAAG,IAAI,CACrB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,UAAU,GAAG,cAAc,GAAG,SAAS,GAAG,OAAO,CAC/D,GAAG;IACF,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,yDAAyD;IACzD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gCAAgC;IAChC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8DAA8D;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,oEAAoE;IACpE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;OAGG;IACH,WAAW,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAAC;IAC9D,sFAAsF;IACtF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oEAAoE;IACpE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2DAA2D;IAC3D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,2CA+DjC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -3,84 +3,50 @@ import { useId, useRef, useState } from "react";
|
|
|
3
3
|
import { FieldTemplate } from "../../services/fieldTemplate";
|
|
4
4
|
import "./styles.css";
|
|
5
5
|
/**
|
|
6
|
-
* Switch
|
|
6
|
+
* Switch — toggle input for binary on/off states.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param props.label - Optional label text to display next to the switch
|
|
11
|
-
* @param props.size - Size variant of the switch. Default: "lg"
|
|
12
|
-
* @param props.defaultChecked - Default checked state for uncontrolled usage. Default: false
|
|
13
|
-
* @param props.checked - Controlled checked state of the switch
|
|
14
|
-
* @param props.value - Value to be used when switch is checked. Default: "checked"
|
|
15
|
-
* @param props.unCheckedValue - Value to be used when switch is unchecked. Default: ""
|
|
16
|
-
* @param props.onCheck - Callback function called when switch state changes, receives the current value
|
|
17
|
-
* @param props.unShowFieldTemplate - When true, skips `FieldTemplate` structure (wrapper, label and error text) and renders only the checkbox button content.
|
|
18
|
-
* @param props.orientation - Layout direction forwarded to `FieldTemplate`/`FieldWrapper` (`horizontal`, `vertical`, `horizontalReverse`). Default: "horizontalReverse"
|
|
8
|
+
* Stores value in a hidden `<input>` for native form submission.
|
|
9
|
+
* Integrates with `useForm` to display validation errors by field name.
|
|
19
10
|
*
|
|
20
|
-
*
|
|
11
|
+
* @param props.name - Field name for form submission. Required.
|
|
12
|
+
* @param props.label - Label text displayed beside the switch.
|
|
13
|
+
* @param props.size - Switch size (`sm` | `md` | `lg`). Default: "lg"
|
|
14
|
+
* @param props.defaultChecked - Uncontrolled initial checked state. Default: false
|
|
15
|
+
* @param props.checked - Controlled checked state.
|
|
16
|
+
* @param props.value - Value emitted when on. Default: "checked"
|
|
17
|
+
* @param props.unCheckedValue - Value emitted when off. Default: ""
|
|
18
|
+
* @param props.onCheck - Callback fired on toggle — receives the current value string.
|
|
19
|
+
* @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: "horizontalReverse"
|
|
20
|
+
* @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false
|
|
21
|
+
* @param props.showAsterisk - Appends `*` to the label.
|
|
22
|
+
* @param props.errorMessage - Validation error message.
|
|
21
23
|
*
|
|
22
|
-
*
|
|
24
|
+
* **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**
|
|
25
|
+
*
|
|
26
|
+
* @returns Switch JSX element wrapped in `FieldTemplate`.
|
|
23
27
|
*
|
|
24
28
|
* @example
|
|
25
29
|
* ```tsx
|
|
26
|
-
* // Basic
|
|
30
|
+
* // Basic
|
|
27
31
|
* <Switch name="notifications" label="Enable notifications" />
|
|
28
32
|
*
|
|
29
|
-
* //
|
|
33
|
+
* // Custom on/off values
|
|
30
34
|
* <Switch
|
|
31
35
|
* name="theme"
|
|
32
36
|
* label="Dark mode"
|
|
33
37
|
* value="dark"
|
|
34
38
|
* unCheckedValue="light"
|
|
35
|
-
* onCheck={(
|
|
39
|
+
* onCheck={(v) => setTheme(v)}
|
|
36
40
|
* />
|
|
37
41
|
*
|
|
38
|
-
* // Controlled
|
|
42
|
+
* // Controlled
|
|
39
43
|
* <Switch
|
|
40
44
|
* name="autoSave"
|
|
41
|
-
* label="Auto-save
|
|
45
|
+
* label="Auto-save"
|
|
42
46
|
* checked={isAutoSaveEnabled}
|
|
43
|
-
* onCheck={(
|
|
47
|
+
* onCheck={(v) => setAutoSave(!!v)}
|
|
44
48
|
* size="md"
|
|
45
49
|
* />
|
|
46
|
-
*
|
|
47
|
-
* // Small switch with default checked state
|
|
48
|
-
* <Switch
|
|
49
|
-
* name="marketing"
|
|
50
|
-
* label="Marketing emails"
|
|
51
|
-
* size="sm"
|
|
52
|
-
* defaultChecked={true}
|
|
53
|
-
* value="subscribed"
|
|
54
|
-
* unCheckedValue="unsubscribed"
|
|
55
|
-
* />
|
|
56
|
-
*
|
|
57
|
-
* // Switch with custom styling and disabled state
|
|
58
|
-
* <Switch
|
|
59
|
-
* name="premium"
|
|
60
|
-
* label="Premium features"
|
|
61
|
-
* className="premium-switch"
|
|
62
|
-
* disabled={!isPremiumUser}
|
|
63
|
-
* onCheck={(value) => handlePremiumToggle(value)}
|
|
64
|
-
* />
|
|
65
|
-
*
|
|
66
|
-
* // Large switch for accessibility
|
|
67
|
-
* <Switch
|
|
68
|
-
* name="accessibility"
|
|
69
|
-
* label="High contrast mode"
|
|
70
|
-
* size="lg"
|
|
71
|
-
* checked={isHighContrast}
|
|
72
|
-
* onCheck={(value) => setIsHighContrast(!!value)}
|
|
73
|
-
* value="enabled"
|
|
74
|
-
* unCheckedValue="disabled"
|
|
75
|
-
* />
|
|
76
|
-
*
|
|
77
|
-
* // Switch without label for inline usage
|
|
78
|
-
* <Switch
|
|
79
|
-
* name="inline_toggle"
|
|
80
|
-
* value="on"
|
|
81
|
-
* unCheckedValue="off"
|
|
82
|
-
* onCheck={(value) => console.log('Toggle state:', value)}
|
|
83
|
-
* />
|
|
84
50
|
* ```
|
|
85
51
|
*/
|
|
86
52
|
function Switch(props) {
|
|
@@ -1,69 +1,31 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from "react";
|
|
2
2
|
import "./styles.css";
|
|
3
3
|
type TabButtonProps = Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "value" | "type"> & {
|
|
4
|
+
/** Content displayed inside the tab button. */
|
|
4
5
|
children: ReactNode;
|
|
6
|
+
/** Unique identifier for this tab; matched against the container's active value. */
|
|
5
7
|
value: string;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
|
-
* TabButton
|
|
10
|
+
* TabButton — individual tab button inside a `TabContainer`.
|
|
9
11
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* @param props.value - Unique identifier for the tab button (required)
|
|
13
|
-
* @param props.disabled - Whether the button is disabled. Can be overridden by TabContainer's disabled state
|
|
12
|
+
* Reads active state and disabled state from `TabContainer` context.
|
|
13
|
+
* The button's own `disabled` prop is ORed with the container's `disabled`.
|
|
14
14
|
*
|
|
15
|
-
*
|
|
15
|
+
* @param props.children - Tab label content. Required.
|
|
16
|
+
* @param props.value - Tab identifier. Required.
|
|
17
|
+
* @param props.disabled - Disables this tab individually (container can also disable all tabs).
|
|
16
18
|
*
|
|
17
|
-
*
|
|
19
|
+
* **...Other valid HTML `<button>` properties except `type`**
|
|
18
20
|
*
|
|
19
|
-
* @
|
|
20
|
-
* ```tsx
|
|
21
|
-
* // Basic tab buttons within TabContainer
|
|
22
|
-
* <TabContainer>
|
|
23
|
-
* <TabButton value="home">Home</TabButton>
|
|
24
|
-
* <TabButton value="about">About</TabButton>
|
|
25
|
-
* <TabButton value="contact">Contact</TabButton>
|
|
26
|
-
* </TabContainer>
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* ```tsx
|
|
31
|
-
* // Tab button with click handler
|
|
32
|
-
* <TabContainer onChange={(value) => console.log('Tab changed:', value)}>
|
|
33
|
-
* <TabButton
|
|
34
|
-
* value="profile"
|
|
35
|
-
* onClick={() => console.log('Profile tab clicked')}
|
|
36
|
-
* >
|
|
37
|
-
* Profile
|
|
38
|
-
* </TabButton>
|
|
39
|
-
* <TabButton value="settings">Settings</TabButton>
|
|
40
|
-
* </TabContainer>
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* ```tsx
|
|
45
|
-
* // Disabled tab button
|
|
46
|
-
* <TabContainer>
|
|
47
|
-
* <TabButton value="available">Available</TabButton>
|
|
48
|
-
* <TabButton value="coming-soon" disabled>
|
|
49
|
-
* Coming Soon
|
|
50
|
-
* </TabButton>
|
|
51
|
-
* </TabContainer>
|
|
52
|
-
* ```
|
|
21
|
+
* @returns TabButton JSX element.
|
|
53
22
|
*
|
|
54
23
|
* @example
|
|
55
24
|
* ```tsx
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* <TabButton
|
|
59
|
-
*
|
|
60
|
-
* className="custom-tab"
|
|
61
|
-
* aria-label="Dashboard tab"
|
|
62
|
-
* >
|
|
63
|
-
* Dashboard
|
|
64
|
-
* </TabButton>
|
|
65
|
-
* <TabButton value="analytics">Analytics</TabButton>
|
|
66
|
-
* <TabButton value="reports">Reports</TabButton>
|
|
25
|
+
* <TabContainer defaultValue="overview" onChange={setTab}>
|
|
26
|
+
* <TabButton value="overview">Overview</TabButton>
|
|
27
|
+
* <TabButton value="activity">Activity</TabButton>
|
|
28
|
+
* <TabButton value="settings" disabled>Settings</TabButton>
|
|
67
29
|
* </TabContainer>
|
|
68
30
|
* ```
|
|
69
31
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tab/tabButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,OAAO,cAAc,CAAC;AAEtB,KAAK,cAAc,GAAG,IAAI,CACxB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,MAAM,CAC9B,GAAG;IACF,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/tab/tabButton/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAc,SAAS,EAAE,MAAM,OAAO,CAAC;AAGpE,OAAO,cAAc,CAAC;AAEtB,KAAK,cAAc,GAAG,IAAI,CACxB,oBAAoB,CAAC,iBAAiB,CAAC,EACvC,UAAU,GAAG,OAAO,GAAG,MAAM,CAC9B,GAAG;IACF,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,CAAC;IACpB,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,iBAAS,SAAS,CAAC,KAAK,EAAE,cAAc,2CAkCvC;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -2,65 +2,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTab } from "../tabContext";
|
|
3
3
|
import "./styles.css";
|
|
4
4
|
/**
|
|
5
|
-
* TabButton
|
|
5
|
+
* TabButton — individual tab button inside a `TabContainer`.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* @param props.value - Unique identifier for the tab button (required)
|
|
10
|
-
* @param props.disabled - Whether the button is disabled. Can be overridden by TabContainer's disabled state
|
|
7
|
+
* Reads active state and disabled state from `TabContainer` context.
|
|
8
|
+
* The button's own `disabled` prop is ORed with the container's `disabled`.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
10
|
+
* @param props.children - Tab label content. Required.
|
|
11
|
+
* @param props.value - Tab identifier. Required.
|
|
12
|
+
* @param props.disabled - Disables this tab individually (container can also disable all tabs).
|
|
13
13
|
*
|
|
14
|
-
*
|
|
14
|
+
* **...Other valid HTML `<button>` properties except `type`**
|
|
15
15
|
*
|
|
16
|
-
* @
|
|
17
|
-
* ```tsx
|
|
18
|
-
* // Basic tab buttons within TabContainer
|
|
19
|
-
* <TabContainer>
|
|
20
|
-
* <TabButton value="home">Home</TabButton>
|
|
21
|
-
* <TabButton value="about">About</TabButton>
|
|
22
|
-
* <TabButton value="contact">Contact</TabButton>
|
|
23
|
-
* </TabContainer>
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* // Tab button with click handler
|
|
29
|
-
* <TabContainer onChange={(value) => console.log('Tab changed:', value)}>
|
|
30
|
-
* <TabButton
|
|
31
|
-
* value="profile"
|
|
32
|
-
* onClick={() => console.log('Profile tab clicked')}
|
|
33
|
-
* >
|
|
34
|
-
* Profile
|
|
35
|
-
* </TabButton>
|
|
36
|
-
* <TabButton value="settings">Settings</TabButton>
|
|
37
|
-
* </TabContainer>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```tsx
|
|
42
|
-
* // Disabled tab button
|
|
43
|
-
* <TabContainer>
|
|
44
|
-
* <TabButton value="available">Available</TabButton>
|
|
45
|
-
* <TabButton value="coming-soon" disabled>
|
|
46
|
-
* Coming Soon
|
|
47
|
-
* </TabButton>
|
|
48
|
-
* </TabContainer>
|
|
49
|
-
* ```
|
|
16
|
+
* @returns TabButton JSX element.
|
|
50
17
|
*
|
|
51
18
|
* @example
|
|
52
19
|
* ```tsx
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* <TabButton
|
|
56
|
-
*
|
|
57
|
-
* className="custom-tab"
|
|
58
|
-
* aria-label="Dashboard tab"
|
|
59
|
-
* >
|
|
60
|
-
* Dashboard
|
|
61
|
-
* </TabButton>
|
|
62
|
-
* <TabButton value="analytics">Analytics</TabButton>
|
|
63
|
-
* <TabButton value="reports">Reports</TabButton>
|
|
20
|
+
* <TabContainer defaultValue="overview" onChange={setTab}>
|
|
21
|
+
* <TabButton value="overview">Overview</TabButton>
|
|
22
|
+
* <TabButton value="activity">Activity</TabButton>
|
|
23
|
+
* <TabButton value="settings" disabled>Settings</TabButton>
|
|
64
24
|
* </TabContainer>
|
|
65
25
|
* ```
|
|
66
26
|
*/
|