@koide-labs/ui 0.0.15 → 0.1.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.
- package/dist/-utils.d.ts +2 -2
- package/dist/-utils.js +1 -1
- package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
- package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
- package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
- package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
- package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
- package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
- package/dist/accordion.css +1 -0
- package/dist/alert-dialog.css +1 -0
- package/dist/anchor.css +1 -0
- package/dist/avatar.css +1 -0
- package/dist/badge.css +1 -0
- package/dist/button.css +1 -0
- package/dist/checkbox.css +1 -0
- package/dist/code.css +1 -0
- package/dist/collapse.css +1 -0
- package/dist/command.css +1 -0
- package/dist/components/accordion/accordion.d.ts +19 -0
- package/dist/components/accordion/accordion.js +701 -0
- package/dist/components/accordion/index.d.ts +1 -12
- package/dist/components/accordion/index.js +2 -697
- package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
- package/dist/components/alert-dialog/alert-dialog.js +138 -0
- package/dist/components/alert-dialog/index.d.ts +1 -26
- package/dist/components/alert-dialog/index.js +2 -134
- package/dist/components/anchor/anchor.d.ts +12 -0
- package/dist/components/anchor/anchor.js +21 -0
- package/dist/components/anchor/index.d.ts +1 -8
- package/dist/components/anchor/index.js +2 -19
- package/dist/components/avatar/avatar.d.ts +25 -0
- package/dist/components/avatar/avatar.js +161 -0
- package/dist/components/avatar/index.d.ts +1 -21
- package/dist/components/avatar/index.js +2 -159
- package/dist/components/badge/badge.d.ts +20 -0
- package/dist/components/badge/badge.js +42 -0
- package/dist/components/badge/index.d.ts +1 -16
- package/dist/components/badge/index.js +2 -40
- package/dist/components/button/button.d.ts +27 -0
- package/dist/components/button/button.js +47 -0
- package/dist/components/button/index.d.ts +1 -24
- package/dist/components/button/index.js +2 -45
- package/dist/components/checkbox/checkbox.d.ts +13 -0
- package/dist/components/checkbox/checkbox.js +269 -0
- package/dist/components/checkbox/index.d.ts +1 -9
- package/dist/components/checkbox/index.js +2 -267
- package/dist/components/code/code.d.ts +13 -0
- package/dist/components/code/code.js +1206 -0
- package/dist/components/code/index.d.ts +1 -9
- package/dist/components/code/index.js +2 -1204
- package/dist/components/collapse/collapse.d.ts +14 -0
- package/dist/components/collapse/collapse.js +35 -0
- package/dist/components/collapse/index.d.ts +1 -11
- package/dist/components/collapse/index.js +2 -33
- package/dist/components/command/command.d.ts +36 -0
- package/dist/components/command/command.js +1695 -0
- package/dist/components/command/index.d.ts +1 -15
- package/dist/components/command/index.js +2 -1693
- package/dist/components/context-menu/context-menu.d.ts +82 -0
- package/dist/components/context-menu/context-menu.js +1445 -0
- package/dist/components/context-menu/index.d.ts +1 -42
- package/dist/components/context-menu/index.js +2 -1442
- package/dist/components/dialog/dialog.d.ts +22 -0
- package/dist/components/dialog/dialog.js +140 -0
- package/dist/components/dialog/dialog.types.d.ts +38 -0
- package/dist/components/dialog/index.d.ts +1 -48
- package/dist/components/dialog/index.js +2 -136
- package/dist/components/heading/heading.d.ts +25 -0
- package/dist/components/heading/heading.js +36 -0
- package/dist/components/heading/index.d.ts +1 -44
- package/dist/components/heading/index.js +2 -49
- package/dist/components/icon/icon.d.ts +28 -0
- package/dist/components/icon/icon.js +43 -0
- package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
- package/dist/components/icon/icon.types.js +1 -0
- package/dist/components/icon/index.d.ts +2 -24
- package/dist/components/icon/index.js +2 -41
- package/dist/components/icon-button/icon-button.d.ts +16 -0
- package/dist/components/icon-button/icon-button.js +46 -0
- package/dist/components/icon-button/index.d.ts +1 -12
- package/dist/components/icon-button/index.js +2 -44
- package/dist/components/inline-code/index.d.ts +1 -6
- package/dist/components/inline-code/index.js +2 -20
- package/dist/components/inline-code/inline-code.d.ts +10 -0
- package/dist/components/inline-code/inline-code.js +25 -0
- package/dist/components/input/index.d.ts +1 -3
- package/dist/components/input/index.js +2 -117
- package/dist/components/input/input.d.ts +9 -0
- package/dist/components/input/input.js +126 -0
- package/dist/components/meter/index.d.ts +1 -18
- package/dist/components/meter/index.js +2 -163
- package/dist/components/meter/meter.d.ts +22 -0
- package/dist/components/meter/meter.js +165 -0
- package/dist/components/multiline-input/index.d.ts +1 -6
- package/dist/components/multiline-input/index.js +2 -98
- package/dist/components/multiline-input/multiline-input.d.ts +10 -0
- package/dist/components/multiline-input/multiline-input.js +100 -0
- package/dist/components/number-input/index.d.ts +1 -10
- package/dist/components/number-input/index.js +2 -1167
- package/dist/components/number-input/number-input.d.ts +14 -0
- package/dist/components/number-input/number-input.js +1169 -0
- package/dist/components/password-input/index.d.ts +1 -2
- package/dist/components/password-input/index.js +2 -27
- package/dist/components/password-input/password-input.d.ts +7 -0
- package/dist/components/password-input/password-input.js +29 -0
- package/dist/components/pill/index.d.ts +1 -13
- package/dist/components/pill/index.js +2 -36
- package/dist/components/pill/pill.d.ts +17 -0
- package/dist/components/pill/pill.js +38 -0
- package/dist/components/popover/index.d.ts +1 -21
- package/dist/components/popover/index.js +2 -634
- package/dist/components/popover/popover.d.ts +22 -0
- package/dist/components/popover/popover.js +634 -0
- package/dist/components/preview-card/index.d.ts +1 -17
- package/dist/components/preview-card/index.js +2 -400
- package/dist/components/preview-card/preview-card.d.ts +21 -0
- package/dist/components/preview-card/preview-card.js +402 -0
- package/dist/components/radio-group/index.d.ts +1 -0
- package/dist/components/radio-group/index.js +5 -0
- package/dist/components/radio-group/radio-group.d.ts +25 -0
- package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
- package/dist/components/search-bar/index.d.ts +1 -12
- package/dist/components/search-bar/index.js +2 -46
- package/dist/components/search-bar/search-bar.d.ts +16 -0
- package/dist/components/search-bar/search-bar.js +43 -0
- package/dist/components/select/index.d.ts +1 -16
- package/dist/components/select/index.js +2 -1261
- package/dist/components/select/select.d.ts +22 -0
- package/dist/components/select/select.js +1263 -0
- package/dist/components/separator/index.d.ts +1 -7
- package/dist/components/separator/index.js +2 -4
- package/dist/components/separator/separator.d.ts +10 -0
- package/dist/components/separator/separator.js +6 -0
- package/dist/components/slider/index.d.ts +1 -5
- package/dist/components/slider/index.js +2 -900
- package/dist/components/slider/slider.d.ts +10 -0
- package/dist/components/slider/slider.js +899 -0
- package/dist/components/spinner/index.d.ts +1 -2
- package/dist/components/spinner/index.js +2 -11
- package/dist/components/spinner/spinner.d.ts +7 -0
- package/dist/components/spinner/spinner.js +13 -0
- package/dist/components/stacked-avatars/index.d.ts +1 -14
- package/dist/components/stacked-avatars/index.js +2 -90
- package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
- package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
- package/dist/components/status-banner/index.d.ts +1 -17
- package/dist/components/status-banner/index.js +2 -69
- package/dist/components/status-banner/status-banner.d.ts +22 -0
- package/dist/components/status-banner/status-banner.js +71 -0
- package/dist/components/surface/index.d.ts +2 -27
- package/dist/components/surface/index.js +2 -39
- package/dist/components/surface/surface.d.ts +26 -0
- package/dist/components/surface/surface.js +36 -0
- package/dist/components/surface/surface.types.d.ts +1 -0
- package/dist/components/surface/surface.types.js +1 -0
- package/dist/components/switch/index.d.ts +1 -5
- package/dist/components/switch/index.js +2 -194
- package/dist/components/switch/switch.d.ts +10 -0
- package/dist/components/switch/switch.js +193 -0
- package/dist/components/tabs/index.d.ts +1 -18
- package/dist/components/tabs/index.js +2 -507
- package/dist/components/tabs/tabs.d.ts +28 -0
- package/dist/components/tabs/tabs.js +511 -0
- package/dist/components/text/index.d.ts +1 -26
- package/dist/components/text/index.js +2 -46
- package/dist/components/text/text.d.ts +29 -0
- package/dist/components/text/text.js +48 -0
- package/dist/components/theme-provider/index.d.ts +1 -1
- package/dist/components/theme-provider/theme-provider.d.ts +8 -4
- package/dist/components/theme-provider/theme-provider.js +3 -3
- package/dist/components/timestamp/index.d.ts +1 -23
- package/dist/components/timestamp/index.js +2 -1390
- package/dist/components/timestamp/timestamp.d.ts +26 -0
- package/dist/components/timestamp/timestamp.js +1391 -0
- package/dist/components/toaster/index.d.ts +2 -0
- package/dist/components/toaster/index.js +7 -0
- package/dist/components/toaster/toaster.d.ts +7 -0
- package/dist/components/toaster/toaster.js +923 -0
- package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
- package/dist/components/tooltip/index.d.ts +1 -14
- package/dist/components/tooltip/index.js +2 -710
- package/dist/components/tooltip/tooltip.d.ts +24 -0
- package/dist/components/tooltip/tooltip.js +9 -0
- package/dist/components/view/index.d.ts +2 -30
- package/dist/components/view/index.js +2 -79
- package/dist/components/view/view.d.ts +31 -0
- package/dist/components/view/view.js +83 -0
- package/dist/components/view/view.types.d.ts +5 -0
- package/dist/components/view/view.types.js +1 -0
- package/dist/components/visually-hidden/index.d.ts +5 -1
- package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
- package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
- package/dist/context-menu.css +1 -0
- package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
- package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
- package/dist/dialog.css +1 -1
- package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
- package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
- package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
- package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
- package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
- package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
- package/dist/heading.css +1 -0
- package/dist/icon-button.css +1 -0
- package/dist/icon.css +1 -0
- package/dist/index.d.ts +10 -10
- package/dist/index.js +86 -104
- package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
- package/dist/inline-code.css +1 -0
- package/dist/input.css +1 -1
- package/dist/input.module-CtE19OH8.js +8 -0
- package/dist/integrations/react-markdown/index.js +12 -12
- package/dist/meter.css +1 -0
- package/dist/number-input.css +1 -0
- package/dist/password-input.css +1 -0
- package/dist/pill.css +1 -0
- package/dist/popover.css +1 -0
- package/dist/preview-card.css +1 -0
- package/dist/radio-group.css +1 -0
- package/dist/safePolygon-DnkzOIur.js +558 -0
- package/dist/search-bar.css +1 -0
- package/dist/select.css +1 -0
- package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
- package/dist/separator.css +1 -0
- package/dist/slider.css +1 -0
- package/dist/spinner.css +1 -0
- package/dist/stacked-avatars.css +1 -0
- package/dist/status-banner.css +1 -0
- package/dist/styles/core.css +1 -1
- package/dist/surface.css +1 -0
- package/dist/switch.css +1 -0
- package/dist/tabs.css +1 -0
- package/dist/text.css +1 -0
- package/dist/timestamp.css +1 -0
- package/dist/toaster.css +1 -0
- package/dist/tooltip-oCp-elli.js +765 -0
- package/dist/tooltip.css +1 -0
- package/dist/transitions.css +1 -1
- package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
- package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
- package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
- package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
- package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
- package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
- package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
- package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
- package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
- package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
- package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
- package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
- package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
- package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
- package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
- package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
- package/dist/view.css +1 -1
- package/dist/view.module-Dj7wj0kk.js +6 -0
- package/dist/view2.css +1 -0
- package/package.json +1 -1
- package/dist/components/radio/index.d.ts +0 -13
- package/dist/components/toast/index.d.ts +0 -2
- package/dist/components/toast/index.js +0 -8
- package/dist/components/toast/toast.d.ts +0 -2
- package/dist/components/toast/toast.js +0 -921
- package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
- package/dist/components/tooltip/tooltip-arrow.js +0 -6
- package/dist/index10.css +0 -1
- package/dist/index11.css +0 -1
- package/dist/index12.css +0 -1
- package/dist/index13.css +0 -1
- package/dist/index14.css +0 -1
- package/dist/index15.css +0 -1
- package/dist/index16.css +0 -1
- package/dist/index17.css +0 -1
- package/dist/index18.css +0 -1
- package/dist/index19.css +0 -1
- package/dist/index20.css +0 -1
- package/dist/index21.css +0 -1
- package/dist/index22.css +0 -1
- package/dist/index23.css +0 -1
- package/dist/index24.css +0 -1
- package/dist/index25.css +0 -1
- package/dist/index26.css +0 -1
- package/dist/index27.css +0 -1
- package/dist/index28.css +0 -1
- package/dist/index29.css +0 -1
- package/dist/index3.css +0 -1
- package/dist/index30.css +0 -1
- package/dist/index31.css +0 -1
- package/dist/index32.css +0 -1
- package/dist/index33.css +0 -1
- package/dist/index34.css +0 -1
- package/dist/index35.css +0 -1
- package/dist/index36.css +0 -1
- package/dist/index37.css +0 -1
- package/dist/index4.css +0 -1
- package/dist/index5.css +0 -1
- package/dist/index6.css +0 -1
- package/dist/index7.css +0 -1
- package/dist/index8.css +0 -1
- package/dist/index9.css +0 -1
- package/dist/input.module-DDQY_Ij6.js +0 -7
- package/dist/safePolygon-DWy1dGKJ.js +0 -308
- package/dist/toast.css +0 -1
- package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
- package/dist/tooltip-arrow.css +0 -1
- package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
- package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
- package/dist/view.module-DfDLgJE0.js +0 -6
- /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
- /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
|
@@ -1,197 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { View as se } from "../view/index.js";
|
|
4
|
-
import * as s from "react";
|
|
5
|
-
import { f as ie } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
6
|
-
import { c as re, m as ce, u as M } from "../../useRenderElement-DwToLA61.js";
|
|
7
|
-
import { f as de, c as le, a as O, u as ue, b as fe } from "../../LabelableContext-BMvjVwor.js";
|
|
8
|
-
import { u as me } from "../../useControlled-Du4sJyMj.js";
|
|
9
|
-
import { u as pe } from "../../useStableCallback-CkTrVkNX.js";
|
|
10
|
-
import { u as he } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
11
|
-
import { v as ke } from "../../visuallyHidden-CpJ-mhai.js";
|
|
12
|
-
import { u as ve } from "../../useBaseUiId-B7WyxtIE.js";
|
|
13
|
-
import { u as Ce } from "../../useLabelableId-Ci_jDvmv.js";
|
|
14
|
-
import { c as be, n as ye } from "../../createBaseUIEventDetails-D8M2Yl-a.js";
|
|
15
|
-
import { u as we } from "../../useValueChanged-DL757-yD.js";
|
|
16
|
-
import { u as ge } from "../../useButton-DfIwsdb8.js";
|
|
17
|
-
import '../../index23.css';const b = /* @__PURE__ */ s.createContext(void 0);
|
|
18
|
-
process.env.NODE_ENV !== "production" && (b.displayName = "SwitchRootContext");
|
|
19
|
-
function xe() {
|
|
20
|
-
const e = s.useContext(b);
|
|
21
|
-
if (e === void 0)
|
|
22
|
-
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>." : ie(63));
|
|
23
|
-
return e;
|
|
24
|
-
}
|
|
25
|
-
let B = /* @__PURE__ */ (function(e) {
|
|
26
|
-
return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
27
|
-
})({});
|
|
28
|
-
const T = {
|
|
29
|
-
...de,
|
|
30
|
-
checked(e) {
|
|
31
|
-
return e ? {
|
|
32
|
-
[B.checked]: ""
|
|
33
|
-
} : {
|
|
34
|
-
[B.unchecked]: ""
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}, q = /* @__PURE__ */ s.forwardRef(function(i, m) {
|
|
38
|
-
const {
|
|
39
|
-
checked: y,
|
|
40
|
-
className: j,
|
|
41
|
-
defaultChecked: p,
|
|
42
|
-
id: h,
|
|
43
|
-
inputRef: k,
|
|
44
|
-
name: v,
|
|
45
|
-
nativeButton: U = !1,
|
|
46
|
-
onCheckedChange: H,
|
|
47
|
-
readOnly: l = !1,
|
|
48
|
-
required: u = !1,
|
|
49
|
-
disabled: z = !1,
|
|
50
|
-
render: Ee,
|
|
51
|
-
uncheckedValue: w,
|
|
52
|
-
...D
|
|
53
|
-
} = i, {
|
|
54
|
-
clearErrors: G
|
|
55
|
-
} = le(), {
|
|
56
|
-
state: g,
|
|
57
|
-
setTouched: J,
|
|
58
|
-
setDirty: K,
|
|
59
|
-
validityData: Q,
|
|
60
|
-
setFilled: C,
|
|
61
|
-
setFocused: x,
|
|
62
|
-
shouldValidateOnChange: W,
|
|
63
|
-
validationMode: X,
|
|
64
|
-
disabled: Y,
|
|
65
|
-
name: Z,
|
|
66
|
-
validation: n
|
|
67
|
-
} = O(), {
|
|
68
|
-
labelId: $
|
|
69
|
-
} = ue(), o = Y || z, r = Z ?? v, _ = pe(H), c = s.useRef(null), E = re(c, k, n.inputRef), f = s.useRef(null), N = ve(), R = Ce({
|
|
70
|
-
id: h,
|
|
71
|
-
implicit: !1,
|
|
72
|
-
controlRef: f
|
|
73
|
-
}), [t, P] = me({
|
|
74
|
-
controlled: y,
|
|
75
|
-
default: !!p,
|
|
76
|
-
name: "Switch",
|
|
77
|
-
state: "checked"
|
|
78
|
-
});
|
|
79
|
-
fe({
|
|
80
|
-
id: N,
|
|
81
|
-
commit: n.commit,
|
|
82
|
-
value: t,
|
|
83
|
-
controlRef: f,
|
|
84
|
-
name: r,
|
|
85
|
-
getValue: () => t
|
|
86
|
-
}), he(() => {
|
|
87
|
-
c.current && C(c.current.checked);
|
|
88
|
-
}, [c, C]), we(t, () => {
|
|
89
|
-
G(r), K(t !== Q.initialValue), C(t), W() ? n.commit(t) : n.commit(t, !0);
|
|
90
|
-
});
|
|
91
|
-
const {
|
|
92
|
-
getButtonProps: A,
|
|
93
|
-
buttonRef: ee
|
|
94
|
-
} = ge({
|
|
95
|
-
disabled: o,
|
|
96
|
-
native: U
|
|
97
|
-
}), te = {
|
|
98
|
-
id: N,
|
|
99
|
-
role: "switch",
|
|
100
|
-
"aria-checked": t,
|
|
101
|
-
"aria-readonly": l || void 0,
|
|
102
|
-
"aria-labelledby": $,
|
|
103
|
-
onFocus() {
|
|
104
|
-
o || x(!0);
|
|
105
|
-
},
|
|
106
|
-
onBlur() {
|
|
107
|
-
const a = c.current;
|
|
108
|
-
!a || o || (J(!0), x(!1), X === "onBlur" && n.commit(a.checked));
|
|
109
|
-
},
|
|
110
|
-
onClick(a) {
|
|
111
|
-
l || o || (a.preventDefault(), c?.current?.click());
|
|
112
|
-
}
|
|
113
|
-
}, ne = s.useMemo(() => ce({
|
|
114
|
-
checked: t,
|
|
115
|
-
disabled: o,
|
|
116
|
-
id: R,
|
|
117
|
-
name: r,
|
|
118
|
-
required: u,
|
|
119
|
-
style: ke,
|
|
120
|
-
tabIndex: -1,
|
|
121
|
-
type: "checkbox",
|
|
122
|
-
"aria-hidden": !0,
|
|
123
|
-
ref: E,
|
|
124
|
-
onChange(a) {
|
|
125
|
-
if (a.nativeEvent.defaultPrevented)
|
|
126
|
-
return;
|
|
127
|
-
const I = a.target.checked, S = be(ye, a.nativeEvent);
|
|
128
|
-
_?.(I, S), !S.isCanceled && P(I);
|
|
129
|
-
},
|
|
130
|
-
onFocus() {
|
|
131
|
-
f.current?.focus();
|
|
132
|
-
}
|
|
133
|
-
}, n.getInputValidationProps), [t, o, E, R, r, _, u, P, n]), V = s.useMemo(() => ({
|
|
134
|
-
...g,
|
|
135
|
-
checked: t,
|
|
136
|
-
disabled: o,
|
|
137
|
-
readOnly: l,
|
|
138
|
-
required: u
|
|
139
|
-
}), [g, t, o, l, u]), oe = M("span", i, {
|
|
140
|
-
state: V,
|
|
141
|
-
ref: [m, f, ee],
|
|
142
|
-
props: [te, n.getValidationProps, D, A],
|
|
143
|
-
stateAttributesMapping: T
|
|
144
|
-
});
|
|
145
|
-
return /* @__PURE__ */ ae(b.Provider, {
|
|
146
|
-
value: V,
|
|
147
|
-
children: [oe, !t && r && w !== void 0 && /* @__PURE__ */ d("input", {
|
|
148
|
-
type: "hidden",
|
|
149
|
-
name: r,
|
|
150
|
-
value: w
|
|
151
|
-
}), /* @__PURE__ */ d("input", {
|
|
152
|
-
...ne
|
|
153
|
-
})]
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
process.env.NODE_ENV !== "production" && (q.displayName = "SwitchRoot");
|
|
157
|
-
const L = /* @__PURE__ */ s.forwardRef(function(i, m) {
|
|
158
|
-
const {
|
|
159
|
-
render: y,
|
|
160
|
-
className: j,
|
|
161
|
-
...p
|
|
162
|
-
} = i, {
|
|
163
|
-
state: h
|
|
164
|
-
} = O(), k = xe(), v = {
|
|
165
|
-
...h,
|
|
166
|
-
...k
|
|
167
|
-
};
|
|
168
|
-
return M("span", i, {
|
|
169
|
-
state: v,
|
|
170
|
-
ref: m,
|
|
171
|
-
stateAttributesMapping: T,
|
|
172
|
-
props: p
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
process.env.NODE_ENV !== "production" && (L.displayName = "SwitchThumb");
|
|
176
|
-
const _e = "_switch__thumb_not9b_24", F = {
|
|
177
|
-
switch: "_switch_not9b_1",
|
|
178
|
-
switch__thumb: _e
|
|
179
|
-
};
|
|
180
|
-
function Ue({
|
|
181
|
-
color: e = "primary",
|
|
182
|
-
...i
|
|
183
|
-
}) {
|
|
184
|
-
return /* @__PURE__ */ d(
|
|
185
|
-
se,
|
|
186
|
-
{
|
|
187
|
-
render: /* @__PURE__ */ d(q, { ...i }),
|
|
188
|
-
className: F.switch,
|
|
189
|
-
interactive: "fill-outline",
|
|
190
|
-
color: e,
|
|
191
|
-
children: /* @__PURE__ */ d(L, { className: F.switch__thumb })
|
|
192
|
-
}
|
|
193
|
-
);
|
|
194
|
-
}
|
|
2
|
+
import { Switch as c } from "./switch.js";
|
|
195
3
|
export {
|
|
196
|
-
|
|
4
|
+
c as Switch
|
|
197
5
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Switch as SwitchPrimitive } from '@base-ui/react/switch';
|
|
2
|
+
import { Color } from '../view';
|
|
3
|
+
export interface SwitchProps extends SwitchPrimitive.Root.Props {
|
|
4
|
+
color?: Color;
|
|
5
|
+
}
|
|
6
|
+
declare function Switch({ color, ...props }: SwitchProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { Switch };
|
|
8
|
+
export declare namespace Switch {
|
|
9
|
+
type Props = SwitchProps;
|
|
10
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsxs as ae, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { View as se } from "../view/view.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { f as ie } from "../../formatErrorMessage-BqPuTBN-.js";
|
|
5
|
+
import { d as re, m as ce, u as M } from "../../useRenderElement-DngNDu_P.js";
|
|
6
|
+
import { f as de, c as le, a as O, u as ue, b as fe } from "../../LabelableContext-Be1u-eFg.js";
|
|
7
|
+
import { u as me } from "../../useControlled-Du4sJyMj.js";
|
|
8
|
+
import { u as pe } from "../../useStableCallback-DKZHlUAT.js";
|
|
9
|
+
import { u as he } from "../../useIsoLayoutEffect-CIDbvm3Q.js";
|
|
10
|
+
import { v as ke } from "../../visuallyHidden-CpJ-mhai.js";
|
|
11
|
+
import { u as ve } from "../../useBaseUiId-B7WyxtIE.js";
|
|
12
|
+
import { u as Ce } from "../../useLabelableId-CX4tcfzK.js";
|
|
13
|
+
import { c as ye, n as be } from "../../createBaseUIEventDetails-CCSfZ2vM.js";
|
|
14
|
+
import { u as we } from "../../useValueChanged-MJRmEWz1.js";
|
|
15
|
+
import { u as ge } from "../../useButton-d3_JgBNr.js";
|
|
16
|
+
import '../../switch.css';const y = /* @__PURE__ */ s.createContext(void 0);
|
|
17
|
+
process.env.NODE_ENV !== "production" && (y.displayName = "SwitchRootContext");
|
|
18
|
+
function xe() {
|
|
19
|
+
const e = s.useContext(y);
|
|
20
|
+
if (e === void 0)
|
|
21
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SwitchRootContext is missing. Switch parts must be placed within <Switch.Root>." : ie(63));
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
let B = /* @__PURE__ */ (function(e) {
|
|
25
|
+
return e.checked = "data-checked", e.unchecked = "data-unchecked", e.disabled = "data-disabled", e.readonly = "data-readonly", e.required = "data-required", e.valid = "data-valid", e.invalid = "data-invalid", e.touched = "data-touched", e.dirty = "data-dirty", e.filled = "data-filled", e.focused = "data-focused", e;
|
|
26
|
+
})({});
|
|
27
|
+
const T = {
|
|
28
|
+
...de,
|
|
29
|
+
checked(e) {
|
|
30
|
+
return e ? {
|
|
31
|
+
[B.checked]: ""
|
|
32
|
+
} : {
|
|
33
|
+
[B.unchecked]: ""
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}, q = /* @__PURE__ */ s.forwardRef(function(i, m) {
|
|
37
|
+
const {
|
|
38
|
+
checked: b,
|
|
39
|
+
className: j,
|
|
40
|
+
defaultChecked: p,
|
|
41
|
+
id: h,
|
|
42
|
+
inputRef: k,
|
|
43
|
+
name: v,
|
|
44
|
+
nativeButton: U = !1,
|
|
45
|
+
onCheckedChange: H,
|
|
46
|
+
readOnly: l = !1,
|
|
47
|
+
required: u = !1,
|
|
48
|
+
disabled: z = !1,
|
|
49
|
+
render: Ee,
|
|
50
|
+
uncheckedValue: w,
|
|
51
|
+
...D
|
|
52
|
+
} = i, {
|
|
53
|
+
clearErrors: G
|
|
54
|
+
} = le(), {
|
|
55
|
+
state: g,
|
|
56
|
+
setTouched: J,
|
|
57
|
+
setDirty: K,
|
|
58
|
+
validityData: Q,
|
|
59
|
+
setFilled: C,
|
|
60
|
+
setFocused: x,
|
|
61
|
+
shouldValidateOnChange: W,
|
|
62
|
+
validationMode: X,
|
|
63
|
+
disabled: Y,
|
|
64
|
+
name: Z,
|
|
65
|
+
validation: n
|
|
66
|
+
} = O(), {
|
|
67
|
+
labelId: $
|
|
68
|
+
} = ue(), o = Y || z, r = Z ?? v, _ = pe(H), c = s.useRef(null), E = re(c, k, n.inputRef), f = s.useRef(null), N = ve(), R = Ce({
|
|
69
|
+
id: h,
|
|
70
|
+
implicit: !1,
|
|
71
|
+
controlRef: f
|
|
72
|
+
}), [t, P] = me({
|
|
73
|
+
controlled: b,
|
|
74
|
+
default: !!p,
|
|
75
|
+
name: "Switch",
|
|
76
|
+
state: "checked"
|
|
77
|
+
});
|
|
78
|
+
fe({
|
|
79
|
+
id: N,
|
|
80
|
+
commit: n.commit,
|
|
81
|
+
value: t,
|
|
82
|
+
controlRef: f,
|
|
83
|
+
name: r,
|
|
84
|
+
getValue: () => t
|
|
85
|
+
}), he(() => {
|
|
86
|
+
c.current && C(c.current.checked);
|
|
87
|
+
}, [c, C]), we(t, () => {
|
|
88
|
+
G(r), K(t !== Q.initialValue), C(t), W() ? n.commit(t) : n.commit(t, !0);
|
|
89
|
+
});
|
|
90
|
+
const {
|
|
91
|
+
getButtonProps: A,
|
|
92
|
+
buttonRef: ee
|
|
93
|
+
} = ge({
|
|
94
|
+
disabled: o,
|
|
95
|
+
native: U
|
|
96
|
+
}), te = {
|
|
97
|
+
id: N,
|
|
98
|
+
role: "switch",
|
|
99
|
+
"aria-checked": t,
|
|
100
|
+
"aria-readonly": l || void 0,
|
|
101
|
+
"aria-labelledby": $,
|
|
102
|
+
onFocus() {
|
|
103
|
+
o || x(!0);
|
|
104
|
+
},
|
|
105
|
+
onBlur() {
|
|
106
|
+
const a = c.current;
|
|
107
|
+
!a || o || (J(!0), x(!1), X === "onBlur" && n.commit(a.checked));
|
|
108
|
+
},
|
|
109
|
+
onClick(a) {
|
|
110
|
+
l || o || (a.preventDefault(), c?.current?.click());
|
|
111
|
+
}
|
|
112
|
+
}, ne = s.useMemo(() => ce({
|
|
113
|
+
checked: t,
|
|
114
|
+
disabled: o,
|
|
115
|
+
id: R,
|
|
116
|
+
name: r,
|
|
117
|
+
required: u,
|
|
118
|
+
style: ke,
|
|
119
|
+
tabIndex: -1,
|
|
120
|
+
type: "checkbox",
|
|
121
|
+
"aria-hidden": !0,
|
|
122
|
+
ref: E,
|
|
123
|
+
onChange(a) {
|
|
124
|
+
if (a.nativeEvent.defaultPrevented)
|
|
125
|
+
return;
|
|
126
|
+
const I = a.target.checked, S = ye(be, a.nativeEvent);
|
|
127
|
+
_?.(I, S), !S.isCanceled && P(I);
|
|
128
|
+
},
|
|
129
|
+
onFocus() {
|
|
130
|
+
f.current?.focus();
|
|
131
|
+
}
|
|
132
|
+
}, n.getInputValidationProps), [t, o, E, R, r, _, u, P, n]), V = s.useMemo(() => ({
|
|
133
|
+
...g,
|
|
134
|
+
checked: t,
|
|
135
|
+
disabled: o,
|
|
136
|
+
readOnly: l,
|
|
137
|
+
required: u
|
|
138
|
+
}), [g, t, o, l, u]), oe = M("span", i, {
|
|
139
|
+
state: V,
|
|
140
|
+
ref: [m, f, ee],
|
|
141
|
+
props: [te, n.getValidationProps, D, A],
|
|
142
|
+
stateAttributesMapping: T
|
|
143
|
+
});
|
|
144
|
+
return /* @__PURE__ */ ae(y.Provider, {
|
|
145
|
+
value: V,
|
|
146
|
+
children: [oe, !t && r && w !== void 0 && /* @__PURE__ */ d("input", {
|
|
147
|
+
type: "hidden",
|
|
148
|
+
name: r,
|
|
149
|
+
value: w
|
|
150
|
+
}), /* @__PURE__ */ d("input", {
|
|
151
|
+
...ne
|
|
152
|
+
})]
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
process.env.NODE_ENV !== "production" && (q.displayName = "SwitchRoot");
|
|
156
|
+
const L = /* @__PURE__ */ s.forwardRef(function(i, m) {
|
|
157
|
+
const {
|
|
158
|
+
render: b,
|
|
159
|
+
className: j,
|
|
160
|
+
...p
|
|
161
|
+
} = i, {
|
|
162
|
+
state: h
|
|
163
|
+
} = O(), k = xe(), v = {
|
|
164
|
+
...h,
|
|
165
|
+
...k
|
|
166
|
+
};
|
|
167
|
+
return M("span", i, {
|
|
168
|
+
state: v,
|
|
169
|
+
ref: m,
|
|
170
|
+
stateAttributesMapping: T,
|
|
171
|
+
props: p
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
process.env.NODE_ENV !== "production" && (L.displayName = "SwitchThumb");
|
|
175
|
+
const _e = "_switch__thumb_m68cc_25", F = {
|
|
176
|
+
switch: "_switch_m68cc_2",
|
|
177
|
+
switch__thumb: _e
|
|
178
|
+
};
|
|
179
|
+
function Ue({ color: e = "primary", ...i }) {
|
|
180
|
+
return /* @__PURE__ */ d(
|
|
181
|
+
se,
|
|
182
|
+
{
|
|
183
|
+
render: /* @__PURE__ */ d(q, { ...i }),
|
|
184
|
+
className: F.switch,
|
|
185
|
+
interactive: "fill-outline",
|
|
186
|
+
color: e,
|
|
187
|
+
children: /* @__PURE__ */ d(L, { className: F.switch__thumb })
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
Ue as Switch
|
|
193
|
+
};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ButtonProps } from '../button';
|
|
3
|
-
type TabsTriggerProps = {
|
|
4
|
-
value: TabsPrimitive.Tab.Props["value"];
|
|
5
|
-
/** Show indicator that tab is complete. */
|
|
6
|
-
complete?: boolean;
|
|
7
|
-
} & ButtonProps;
|
|
8
|
-
type TabsVariant = "default" | "progress" | "button-group";
|
|
9
|
-
export interface TabsProps extends TabsPrimitive.Root.Props {
|
|
10
|
-
/** Tabs styling that we should use. Defaults to "default". */
|
|
11
|
-
variant?: TabsVariant;
|
|
12
|
-
/** Disable all triggers */
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
tabs: Array<TabsTriggerProps>;
|
|
15
|
-
}
|
|
16
|
-
export declare function Tabs({ variant, disabled, tabs, className, children, ...props }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
export declare function TabsPanel({ children, ...props }: TabsPrimitive.Panel.Props): import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
export {};
|
|
1
|
+
export { Tabs } from './tabs';
|