@stevederico/skateboard-ui 3.0.2 → 3.6.0
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/App.jsx +13 -13
- package/CHANGELOG.md +64 -0
- package/README.md +59 -65
- package/components/AuthOverlay.jsx +4 -4
- package/components/ProtectedRoute.jsx +1 -1
- package/components/ThemeToggle.jsx +1 -1
- package/components/UpgradeSheet.jsx +2 -2
- package/{core → components/core}/DynamicIcon.jsx +1 -1
- package/{layout → components/layout}/Header.jsx +4 -4
- package/{layout → components/layout}/Layout.jsx +1 -1
- package/{layout → components/layout}/Sidebar.jsx +2 -2
- package/{layout → components/layout}/TabBar.jsx +1 -1
- package/{views → components/views}/LandingView.jsx +5 -5
- package/{views → components/views}/NotFound.jsx +2 -2
- package/{views → components/views}/PaymentView.jsx +1 -1
- package/{views → components/views}/SettingsView.jsx +6 -6
- package/{views → components/views}/SignInView.jsx +6 -6
- package/{views → components/views}/SignOutView.jsx +1 -1
- package/{views → components/views}/SignUpView.jsx +6 -6
- package/{views → components/views}/TextView.jsx +3 -3
- package/hooks/useAuthGate.js +1 -1
- package/index.js +1 -1
- package/package.json +32 -50
- package/shadcn/lib/base-ui/LICENSE +21 -0
- package/shadcn/lib/base-ui/_chunk-01rqe37g.js +70 -0
- package/shadcn/lib/base-ui/_chunk-0h5sskyw.js +347 -0
- package/shadcn/lib/base-ui/_chunk-0xhx4g7r.js +57 -0
- package/shadcn/lib/base-ui/_chunk-1e6khrvm.js +218 -0
- package/shadcn/lib/base-ui/_chunk-1s41sngz.js +302 -0
- package/shadcn/lib/base-ui/_chunk-20rtfsz9.js +23 -0
- package/shadcn/lib/base-ui/_chunk-2tyt8f8r.js +6034 -0
- package/shadcn/lib/base-ui/_chunk-3f31ka8n.js +11 -0
- package/shadcn/lib/base-ui/_chunk-3h6zpchb.js +89 -0
- package/shadcn/lib/base-ui/_chunk-4s0k3h7t.js +114 -0
- package/shadcn/lib/base-ui/_chunk-502wngfc.js +598 -0
- package/shadcn/lib/base-ui/_chunk-536jvgeq.js +68 -0
- package/shadcn/lib/base-ui/_chunk-611pz5sm.js +10 -0
- package/shadcn/lib/base-ui/_chunk-65zw5gs2.js +15 -0
- package/shadcn/lib/base-ui/_chunk-6b17g8t7.js +34 -0
- package/shadcn/lib/base-ui/_chunk-6xevjepc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-71zm6zgv.js +16 -0
- package/shadcn/lib/base-ui/_chunk-7fmjymvh.js +32 -0
- package/shadcn/lib/base-ui/_chunk-7jjzay8b.js +176 -0
- package/shadcn/lib/base-ui/_chunk-7v1t86x1.js +43 -0
- package/shadcn/lib/base-ui/_chunk-85vrgzwr.js +227 -0
- package/shadcn/lib/base-ui/_chunk-8jz3hb7q.js +9 -0
- package/shadcn/lib/base-ui/_chunk-8kh3xk78.js +35 -0
- package/shadcn/lib/base-ui/_chunk-97tas84n.js +67 -0
- package/shadcn/lib/base-ui/_chunk-9nyxkvte.js +13 -0
- package/shadcn/lib/base-ui/_chunk-a8fwg9d0.js +52 -0
- package/shadcn/lib/base-ui/_chunk-agc6ew3g.js +29 -0
- package/shadcn/lib/base-ui/_chunk-aqwsk46c.js +64 -0
- package/shadcn/lib/base-ui/_chunk-atd5kq5q.js +803 -0
- package/shadcn/lib/base-ui/_chunk-atnkefgd.js +104 -0
- package/shadcn/lib/base-ui/_chunk-b40erthe.js +7 -0
- package/shadcn/lib/base-ui/_chunk-b5jsqt97.js +50 -0
- package/shadcn/lib/base-ui/_chunk-bk7n9s9e.js +15 -0
- package/shadcn/lib/base-ui/_chunk-c3572b5x.js +19 -0
- package/shadcn/lib/base-ui/_chunk-cwr896nf.js +25 -0
- package/shadcn/lib/base-ui/_chunk-drfb9kp2.js +27 -0
- package/shadcn/lib/base-ui/_chunk-ds8fnpjj.js +0 -0
- package/shadcn/lib/base-ui/_chunk-ek863ta9.js +82 -0
- package/shadcn/lib/base-ui/_chunk-f09cp81f.js +12 -0
- package/shadcn/lib/base-ui/_chunk-f5d01bp9.js +0 -0
- package/shadcn/lib/base-ui/_chunk-f9tgee1q.js +21 -0
- package/shadcn/lib/base-ui/_chunk-fch5cba8.js +84 -0
- package/shadcn/lib/base-ui/_chunk-gfce3j3z.js +18 -0
- package/shadcn/lib/base-ui/_chunk-ha06w2pp.js +2391 -0
- package/shadcn/lib/base-ui/_chunk-hzgetm70.js +23 -0
- package/shadcn/lib/base-ui/_chunk-j0eqdjta.js +39 -0
- package/shadcn/lib/base-ui/_chunk-k1e5fvcj.js +48 -0
- package/shadcn/lib/base-ui/_chunk-k4mc2kan.js +81 -0
- package/shadcn/lib/base-ui/_chunk-kfz96xv1.js +128 -0
- package/shadcn/lib/base-ui/_chunk-m45547cc.js +15 -0
- package/shadcn/lib/base-ui/_chunk-mbn76q14.js +184 -0
- package/shadcn/lib/base-ui/_chunk-mvv30fkv.js +9 -0
- package/shadcn/lib/base-ui/_chunk-mznt6ktj.js +33 -0
- package/shadcn/lib/base-ui/_chunk-n7dnqnbw.js +7 -0
- package/shadcn/lib/base-ui/_chunk-nya71ccw.js +546 -0
- package/shadcn/lib/base-ui/_chunk-p6qynd6r.js +146 -0
- package/shadcn/lib/base-ui/_chunk-q3nee19r.js +323 -0
- package/shadcn/lib/base-ui/_chunk-q7yw9mz4.js +385 -0
- package/shadcn/lib/base-ui/_chunk-qce0xt57.js +107 -0
- package/shadcn/lib/base-ui/_chunk-qgzhcjsj.js +14 -0
- package/shadcn/lib/base-ui/_chunk-qt6r015s.js +38 -0
- package/shadcn/lib/base-ui/_chunk-r0vsdknk.js +4 -0
- package/shadcn/lib/base-ui/_chunk-sx6vkz01.js +150 -0
- package/shadcn/lib/base-ui/_chunk-szcr6mhk.js +6 -0
- package/shadcn/lib/base-ui/_chunk-t7j3rbpv.js +67 -0
- package/shadcn/lib/base-ui/_chunk-tmfmrzwe.js +39 -0
- package/shadcn/lib/base-ui/_chunk-v92ycsfj.js +9 -0
- package/shadcn/lib/base-ui/_chunk-vdc01ss3.js +6 -0
- package/shadcn/lib/base-ui/_chunk-vjbnhhg1.js +26 -0
- package/shadcn/lib/base-ui/_chunk-w68yxg9d.js +21 -0
- package/shadcn/lib/base-ui/_chunk-wana68v3.js +477 -0
- package/shadcn/lib/base-ui/_chunk-wtw745qd.js +12 -0
- package/shadcn/lib/base-ui/_chunk-xb7ph1ka.js +6 -0
- package/shadcn/lib/base-ui/_chunk-xfagb0fq.js +28 -0
- package/shadcn/lib/base-ui/_chunk-xxhqanfd.js +16 -0
- package/shadcn/lib/base-ui/_chunk-y887e46p.js +15 -0
- package/shadcn/lib/base-ui/_chunk-ymj1dpqg.js +14 -0
- package/shadcn/lib/base-ui/accordion.js +650 -0
- package/shadcn/lib/base-ui/alert-dialog.js +138 -0
- package/shadcn/lib/base-ui/avatar.js +235 -0
- package/shadcn/lib/base-ui/button.js +52 -0
- package/shadcn/lib/base-ui/checkbox.js +454 -0
- package/shadcn/lib/base-ui/collapsible.js +283 -0
- package/shadcn/lib/base-ui/context-menu.js +324 -0
- package/shadcn/lib/base-ui/dialog.js +71 -0
- package/shadcn/lib/base-ui/input.js +1028 -0
- package/shadcn/lib/base-ui/menu.js +61 -0
- package/shadcn/lib/base-ui/menubar.js +157 -0
- package/shadcn/lib/base-ui/merge-props.js +15 -0
- package/shadcn/lib/base-ui/navigation-menu.js +1854 -0
- package/shadcn/lib/base-ui/popover.js +1090 -0
- package/shadcn/lib/base-ui/preview-card.js +709 -0
- package/shadcn/lib/base-ui/progress.js +278 -0
- package/shadcn/lib/base-ui/radio-group.js +247 -0
- package/shadcn/lib/base-ui/radio.js +382 -0
- package/shadcn/lib/base-ui/scroll-area.js +1061 -0
- package/shadcn/lib/base-ui/select.js +2438 -0
- package/shadcn/lib/base-ui/separator.js +11 -0
- package/shadcn/lib/base-ui/slider.js +1595 -0
- package/shadcn/lib/base-ui/switch.js +333 -0
- package/shadcn/lib/base-ui/tabs.js +892 -0
- package/shadcn/lib/base-ui/toggle-group.js +152 -0
- package/shadcn/lib/base-ui/toggle.js +133 -0
- package/shadcn/lib/base-ui/tooltip.js +791 -0
- package/shadcn/lib/base-ui/use-render.js +15 -0
- package/shadcn/lib/tailwind-merge.js +3312 -0
- package/shadcn/lib/utils.js +1 -1
- package/shadcn/ui/accordion.jsx +1 -1
- package/shadcn/ui/alert-dialog.jsx +1 -1
- package/shadcn/ui/avatar.jsx +1 -1
- package/shadcn/ui/badge.jsx +2 -2
- package/shadcn/ui/breadcrumb.jsx +2 -2
- package/shadcn/ui/button-group.jsx +2 -2
- package/shadcn/ui/button.jsx +1 -1
- package/shadcn/ui/calendar.jsx +1 -1
- package/shadcn/ui/checkbox.jsx +1 -1
- package/shadcn/ui/collapsible.jsx +1 -1
- package/shadcn/ui/command.jsx +1 -1
- package/shadcn/ui/context-menu.jsx +1 -1
- package/shadcn/ui/dialog.jsx +1 -1
- package/shadcn/ui/drawer.jsx +176 -74
- package/shadcn/ui/dropdown-menu.jsx +1 -1
- package/shadcn/ui/hover-card.jsx +1 -1
- package/shadcn/ui/input.jsx +1 -1
- package/shadcn/ui/item.jsx +2 -2
- package/shadcn/ui/menubar.jsx +2 -2
- package/shadcn/ui/navigation-menu.jsx +1 -1
- package/shadcn/ui/popover.jsx +1 -1
- package/shadcn/ui/progress.jsx +1 -1
- package/shadcn/ui/radio-group.jsx +2 -2
- package/shadcn/ui/scroll-area.jsx +1 -1
- package/shadcn/ui/select.jsx +1 -1
- package/shadcn/ui/separator.jsx +1 -1
- package/shadcn/ui/sheet.jsx +1 -1
- package/shadcn/ui/sidebar.jsx +3 -3
- package/shadcn/ui/slider.jsx +1 -1
- package/shadcn/ui/switch.jsx +1 -1
- package/shadcn/ui/tabs.jsx +1 -1
- package/shadcn/ui/toggle-group.jsx +2 -2
- package/shadcn/ui/toggle.jsx +1 -1
- package/shadcn/ui/tooltip.jsx +1 -1
- package/styles.css +31 -0
- package/MIGRATION.md +0 -230
- package/shadcn/ui/carousel.jsx +0 -195
- package/shadcn/ui/chart.jsx +0 -312
- package/shadcn/ui/resizable.jsx +0 -47
- /package/{core → components/core}/Calendar.jsx +0 -0
- /package/{core → components/core}/Command.jsx +0 -0
- /package/{core → components/core}/Context.jsx +0 -0
- /package/{core → components/core}/ThemeProvider.jsx +0 -0
- /package/{core → components/core}/Utilities.js +0 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
/* @base-ui/react 1.4.1 — vendored (MIT — MUI Inc).
|
|
2
|
+
* Refresh: scripts/vendor-base-ui.js (see header for instructions).
|
|
3
|
+
* Do not edit by hand. */
|
|
4
|
+
import {
|
|
5
|
+
useRadioGroupContext
|
|
6
|
+
} from "./_chunk-3f31ka8n.js";
|
|
7
|
+
import {
|
|
8
|
+
serializeValue
|
|
9
|
+
} from "./_chunk-xxhqanfd.js";
|
|
10
|
+
import {
|
|
11
|
+
useLabelableId
|
|
12
|
+
} from "./_chunk-k4mc2kan.js";
|
|
13
|
+
import {
|
|
14
|
+
ACTIVE_COMPOSITE_ITEM
|
|
15
|
+
} from "./_chunk-r0vsdknk.js";
|
|
16
|
+
import {
|
|
17
|
+
useAriaLabelledBy
|
|
18
|
+
} from "./_chunk-a8fwg9d0.js";
|
|
19
|
+
import {
|
|
20
|
+
useFieldItemContext
|
|
21
|
+
} from "./_chunk-qgzhcjsj.js";
|
|
22
|
+
import {
|
|
23
|
+
fieldValidityMapping,
|
|
24
|
+
useFieldRootContext,
|
|
25
|
+
useLabelableContext
|
|
26
|
+
} from "./_chunk-kfz96xv1.js";
|
|
27
|
+
import"./_chunk-ds8fnpjj.js";
|
|
28
|
+
import {
|
|
29
|
+
CompositeItem
|
|
30
|
+
} from "./_chunk-j0eqdjta.js";
|
|
31
|
+
import"./_chunk-b5jsqt97.js";
|
|
32
|
+
import"./_chunk-ek863ta9.js";
|
|
33
|
+
import"./_chunk-20rtfsz9.js";
|
|
34
|
+
import {
|
|
35
|
+
visuallyHidden,
|
|
36
|
+
visuallyHiddenInput
|
|
37
|
+
} from "./_chunk-hzgetm70.js";
|
|
38
|
+
import"./_chunk-f5d01bp9.js";
|
|
39
|
+
import {
|
|
40
|
+
createChangeEventDetails,
|
|
41
|
+
exports_reason_parts
|
|
42
|
+
} from "./_chunk-4s0k3h7t.js";
|
|
43
|
+
import {
|
|
44
|
+
useBaseUiId
|
|
45
|
+
} from "./_chunk-8kh3xk78.js";
|
|
46
|
+
import {
|
|
47
|
+
transitionStatusMapping,
|
|
48
|
+
useOpenChangeComplete,
|
|
49
|
+
useTransitionStatus
|
|
50
|
+
} from "./_chunk-mbn76q14.js";
|
|
51
|
+
import"./_chunk-v92ycsfj.js";
|
|
52
|
+
import"./_chunk-3h6zpchb.js";
|
|
53
|
+
import"./_chunk-8jz3hb7q.js";
|
|
54
|
+
import {
|
|
55
|
+
useButton
|
|
56
|
+
} from "./_chunk-85vrgzwr.js";
|
|
57
|
+
import"./_chunk-71zm6zgv.js";
|
|
58
|
+
import"./_chunk-6xevjepc.js";
|
|
59
|
+
import"./_chunk-sx6vkz01.js";
|
|
60
|
+
import"./_chunk-n7dnqnbw.js";
|
|
61
|
+
import {
|
|
62
|
+
useStableCallback
|
|
63
|
+
} from "./_chunk-mznt6ktj.js";
|
|
64
|
+
import {
|
|
65
|
+
useIsoLayoutEffect
|
|
66
|
+
} from "./_chunk-b40erthe.js";
|
|
67
|
+
import {
|
|
68
|
+
EMPTY_OBJECT,
|
|
69
|
+
NOOP,
|
|
70
|
+
useMergedRefs,
|
|
71
|
+
useRenderElement
|
|
72
|
+
} from "./_chunk-1s41sngz.js";
|
|
73
|
+
import {
|
|
74
|
+
__export
|
|
75
|
+
} from "./_chunk-1e6khrvm.js";
|
|
76
|
+
|
|
77
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/index.parts.js
|
|
78
|
+
var exports_index_parts = {};
|
|
79
|
+
__export(exports_index_parts, {
|
|
80
|
+
Root: () => RadioRoot,
|
|
81
|
+
Indicator: () => RadioIndicator
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/root/RadioRoot.js
|
|
85
|
+
import * as React2 from "react";
|
|
86
|
+
|
|
87
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/root/RadioRootDataAttributes.js
|
|
88
|
+
var RadioRootDataAttributes = /* @__PURE__ */ function(RadioRootDataAttributes2) {
|
|
89
|
+
RadioRootDataAttributes2["checked"] = "data-checked";
|
|
90
|
+
RadioRootDataAttributes2["unchecked"] = "data-unchecked";
|
|
91
|
+
RadioRootDataAttributes2["disabled"] = "data-disabled";
|
|
92
|
+
RadioRootDataAttributes2["readonly"] = "data-readonly";
|
|
93
|
+
RadioRootDataAttributes2["required"] = "data-required";
|
|
94
|
+
RadioRootDataAttributes2["valid"] = "data-valid";
|
|
95
|
+
RadioRootDataAttributes2["invalid"] = "data-invalid";
|
|
96
|
+
RadioRootDataAttributes2["touched"] = "data-touched";
|
|
97
|
+
RadioRootDataAttributes2["dirty"] = "data-dirty";
|
|
98
|
+
RadioRootDataAttributes2["filled"] = "data-filled";
|
|
99
|
+
RadioRootDataAttributes2["focused"] = "data-focused";
|
|
100
|
+
return RadioRootDataAttributes2;
|
|
101
|
+
}({});
|
|
102
|
+
|
|
103
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/utils/stateAttributesMapping.js
|
|
104
|
+
var stateAttributesMapping = {
|
|
105
|
+
checked(value) {
|
|
106
|
+
if (value) {
|
|
107
|
+
return {
|
|
108
|
+
[RadioRootDataAttributes.checked]: ""
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
[RadioRootDataAttributes.unchecked]: ""
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
...transitionStatusMapping,
|
|
116
|
+
...fieldValidityMapping
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/root/RadioRootContext.js
|
|
120
|
+
import * as React from "react";
|
|
121
|
+
"use client";
|
|
122
|
+
var RadioRootContext = /* @__PURE__ */ React.createContext(undefined);
|
|
123
|
+
if (true)
|
|
124
|
+
RadioRootContext.displayName = "RadioRootContext";
|
|
125
|
+
function useRadioRootContext() {
|
|
126
|
+
const value = React.useContext(RadioRootContext);
|
|
127
|
+
if (value === undefined) {
|
|
128
|
+
throw new Error("Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>.");
|
|
129
|
+
}
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/root/RadioRoot.js
|
|
134
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
135
|
+
"use client";
|
|
136
|
+
var RadioRoot = /* @__PURE__ */ React2.forwardRef(function RadioRoot2(componentProps, forwardedRef) {
|
|
137
|
+
const {
|
|
138
|
+
render,
|
|
139
|
+
className,
|
|
140
|
+
disabled: disabledProp = false,
|
|
141
|
+
readOnly: readOnlyProp = false,
|
|
142
|
+
required: requiredProp = false,
|
|
143
|
+
"aria-labelledby": ariaLabelledByProp,
|
|
144
|
+
value,
|
|
145
|
+
inputRef: inputRefProp,
|
|
146
|
+
nativeButton = false,
|
|
147
|
+
id: idProp,
|
|
148
|
+
style,
|
|
149
|
+
...elementProps
|
|
150
|
+
} = componentProps;
|
|
151
|
+
const groupContext = useRadioGroupContext();
|
|
152
|
+
const {
|
|
153
|
+
disabled: disabledGroup,
|
|
154
|
+
readOnly: readOnlyGroup,
|
|
155
|
+
required: requiredGroup,
|
|
156
|
+
form: formGroup,
|
|
157
|
+
checkedValue,
|
|
158
|
+
touched = false,
|
|
159
|
+
validation,
|
|
160
|
+
name
|
|
161
|
+
} = groupContext ?? {};
|
|
162
|
+
const setCheckedValue = groupContext?.setCheckedValue ?? NOOP;
|
|
163
|
+
const setTouched = groupContext?.setTouched ?? NOOP;
|
|
164
|
+
const registerControlRef = groupContext?.registerControlRef ?? NOOP;
|
|
165
|
+
const registerInputRef = groupContext?.registerInputRef ?? NOOP;
|
|
166
|
+
const {
|
|
167
|
+
setDirty,
|
|
168
|
+
validityData,
|
|
169
|
+
setTouched: setFieldTouched,
|
|
170
|
+
setFilled,
|
|
171
|
+
state: fieldState,
|
|
172
|
+
disabled: fieldDisabled
|
|
173
|
+
} = useFieldRootContext();
|
|
174
|
+
const fieldItemContext = useFieldItemContext();
|
|
175
|
+
const {
|
|
176
|
+
labelId,
|
|
177
|
+
getDescriptionProps
|
|
178
|
+
} = useLabelableContext();
|
|
179
|
+
const disabled = fieldDisabled || fieldItemContext.disabled || disabledGroup || disabledProp;
|
|
180
|
+
const readOnly = readOnlyGroup || readOnlyProp;
|
|
181
|
+
const required = requiredGroup || requiredProp;
|
|
182
|
+
const form = formGroup;
|
|
183
|
+
const checked = groupContext ? checkedValue === value : value === "";
|
|
184
|
+
const serializedValue = React2.useMemo(() => serializeValue(value), [value]);
|
|
185
|
+
const radioRef = React2.useRef(null);
|
|
186
|
+
const inputRef = React2.useRef(null);
|
|
187
|
+
const handleControlRef = useStableCallback((element2) => {
|
|
188
|
+
if (!element2) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
registerControlRef(element2, disabled);
|
|
192
|
+
});
|
|
193
|
+
const mergedInputRef = useMergedRefs(inputRefProp, inputRef, registerInputRef);
|
|
194
|
+
useIsoLayoutEffect(() => {
|
|
195
|
+
if (inputRef.current?.checked) {
|
|
196
|
+
setFilled(true);
|
|
197
|
+
}
|
|
198
|
+
}, [setFilled]);
|
|
199
|
+
useIsoLayoutEffect(() => {
|
|
200
|
+
if (!inputRef.current) {
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (disabled && checked) {
|
|
204
|
+
registerInputRef(null);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (radioRef.current) {
|
|
208
|
+
registerControlRef(radioRef.current, disabled);
|
|
209
|
+
}
|
|
210
|
+
registerInputRef(inputRef.current);
|
|
211
|
+
}, [checked, disabled, registerControlRef, registerInputRef]);
|
|
212
|
+
const id = useBaseUiId();
|
|
213
|
+
const inputId = useLabelableId({
|
|
214
|
+
id: idProp,
|
|
215
|
+
implicit: false,
|
|
216
|
+
controlRef: radioRef
|
|
217
|
+
});
|
|
218
|
+
const hiddenInputId = nativeButton ? undefined : inputId;
|
|
219
|
+
const ariaLabelledBy = useAriaLabelledBy(ariaLabelledByProp, labelId, inputRef, !nativeButton, hiddenInputId);
|
|
220
|
+
const rootProps = {
|
|
221
|
+
role: "radio",
|
|
222
|
+
"aria-checked": checked,
|
|
223
|
+
"aria-required": required || undefined,
|
|
224
|
+
"aria-readonly": readOnly || undefined,
|
|
225
|
+
"aria-labelledby": ariaLabelledBy,
|
|
226
|
+
[ACTIVE_COMPOSITE_ITEM]: checked ? "" : undefined,
|
|
227
|
+
id: nativeButton ? inputId : id,
|
|
228
|
+
onKeyDown(event) {
|
|
229
|
+
if (event.key === "Enter") {
|
|
230
|
+
event.preventDefault();
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
onClick(event) {
|
|
234
|
+
if (event.defaultPrevented || disabled || readOnly) {
|
|
235
|
+
return;
|
|
236
|
+
}
|
|
237
|
+
event.preventDefault();
|
|
238
|
+
inputRef.current?.dispatchEvent(new PointerEvent("click", {
|
|
239
|
+
bubbles: true,
|
|
240
|
+
shiftKey: event.shiftKey,
|
|
241
|
+
ctrlKey: event.ctrlKey,
|
|
242
|
+
altKey: event.altKey,
|
|
243
|
+
metaKey: event.metaKey
|
|
244
|
+
}));
|
|
245
|
+
},
|
|
246
|
+
onFocus(event) {
|
|
247
|
+
if (event.defaultPrevented || disabled || readOnly || !touched) {
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
inputRef.current?.click();
|
|
251
|
+
setTouched(false);
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const {
|
|
255
|
+
getButtonProps,
|
|
256
|
+
buttonRef
|
|
257
|
+
} = useButton({
|
|
258
|
+
disabled,
|
|
259
|
+
native: nativeButton
|
|
260
|
+
});
|
|
261
|
+
const inputProps = {
|
|
262
|
+
type: "radio",
|
|
263
|
+
ref: mergedInputRef,
|
|
264
|
+
form,
|
|
265
|
+
id: hiddenInputId,
|
|
266
|
+
name,
|
|
267
|
+
tabIndex: -1,
|
|
268
|
+
style: name ? visuallyHiddenInput : visuallyHidden,
|
|
269
|
+
"aria-hidden": true,
|
|
270
|
+
...value !== undefined ? {
|
|
271
|
+
value: serializedValue
|
|
272
|
+
} : EMPTY_OBJECT,
|
|
273
|
+
disabled,
|
|
274
|
+
checked,
|
|
275
|
+
required,
|
|
276
|
+
readOnly,
|
|
277
|
+
onChange(event) {
|
|
278
|
+
if (event.nativeEvent.defaultPrevented) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
if (disabled || readOnly || value === undefined) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const details = createChangeEventDetails(exports_reason_parts.none, event.nativeEvent);
|
|
285
|
+
if (details.isCanceled) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
setFieldTouched(true);
|
|
289
|
+
setDirty(value !== validityData.initialValue);
|
|
290
|
+
setFilled(true);
|
|
291
|
+
setCheckedValue(value, details);
|
|
292
|
+
},
|
|
293
|
+
onFocus() {
|
|
294
|
+
radioRef.current?.focus();
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
const state = React2.useMemo(() => ({
|
|
298
|
+
...fieldState,
|
|
299
|
+
required,
|
|
300
|
+
disabled,
|
|
301
|
+
readOnly,
|
|
302
|
+
checked
|
|
303
|
+
}), [fieldState, disabled, readOnly, checked, required]);
|
|
304
|
+
const contextValue = state;
|
|
305
|
+
const isRadioGroup = groupContext !== undefined;
|
|
306
|
+
const refs = [forwardedRef, radioRef, buttonRef, handleControlRef];
|
|
307
|
+
const props = [rootProps, getDescriptionProps, validation?.getValidationProps ?? EMPTY_OBJECT, elementProps, getButtonProps];
|
|
308
|
+
const element = useRenderElement("span", componentProps, {
|
|
309
|
+
enabled: !isRadioGroup,
|
|
310
|
+
state,
|
|
311
|
+
ref: refs,
|
|
312
|
+
props,
|
|
313
|
+
stateAttributesMapping
|
|
314
|
+
});
|
|
315
|
+
return /* @__PURE__ */ _jsxs(RadioRootContext.Provider, {
|
|
316
|
+
value: contextValue,
|
|
317
|
+
children: [isRadioGroup ? /* @__PURE__ */ _jsx(CompositeItem, {
|
|
318
|
+
tag: "span",
|
|
319
|
+
render,
|
|
320
|
+
className,
|
|
321
|
+
style,
|
|
322
|
+
state,
|
|
323
|
+
refs,
|
|
324
|
+
props,
|
|
325
|
+
stateAttributesMapping
|
|
326
|
+
}) : element, /* @__PURE__ */ _jsx("input", {
|
|
327
|
+
...inputProps,
|
|
328
|
+
suppressHydrationWarning: true
|
|
329
|
+
})]
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
if (true)
|
|
333
|
+
RadioRoot.displayName = "RadioRoot";
|
|
334
|
+
// node_modules/.deno/@base-ui+react@1.4.1/node_modules/@base-ui/react/esm/radio/indicator/RadioIndicator.js
|
|
335
|
+
import * as React3 from "react";
|
|
336
|
+
"use client";
|
|
337
|
+
var RadioIndicator = /* @__PURE__ */ React3.forwardRef(function RadioIndicator2(componentProps, forwardedRef) {
|
|
338
|
+
const {
|
|
339
|
+
render,
|
|
340
|
+
className,
|
|
341
|
+
style,
|
|
342
|
+
keepMounted = false,
|
|
343
|
+
...elementProps
|
|
344
|
+
} = componentProps;
|
|
345
|
+
const rootState = useRadioRootContext();
|
|
346
|
+
const rendered = rootState.checked;
|
|
347
|
+
const {
|
|
348
|
+
mounted,
|
|
349
|
+
transitionStatus,
|
|
350
|
+
setMounted
|
|
351
|
+
} = useTransitionStatus(rendered);
|
|
352
|
+
const state = {
|
|
353
|
+
...rootState,
|
|
354
|
+
transitionStatus
|
|
355
|
+
};
|
|
356
|
+
const indicatorRef = React3.useRef(null);
|
|
357
|
+
const shouldRender = keepMounted || mounted;
|
|
358
|
+
const element = useRenderElement("span", componentProps, {
|
|
359
|
+
ref: [forwardedRef, indicatorRef],
|
|
360
|
+
state,
|
|
361
|
+
props: elementProps,
|
|
362
|
+
stateAttributesMapping
|
|
363
|
+
});
|
|
364
|
+
useOpenChangeComplete({
|
|
365
|
+
open: rendered,
|
|
366
|
+
ref: indicatorRef,
|
|
367
|
+
onComplete() {
|
|
368
|
+
if (!rendered) {
|
|
369
|
+
setMounted(false);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
if (!shouldRender) {
|
|
374
|
+
return null;
|
|
375
|
+
}
|
|
376
|
+
return element;
|
|
377
|
+
});
|
|
378
|
+
if (true)
|
|
379
|
+
RadioIndicator.displayName = "RadioIndicator";
|
|
380
|
+
export {
|
|
381
|
+
exports_index_parts as Radio
|
|
382
|
+
};
|