@hyunsdev/ui 0.1.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/LICENSE +674 -0
- package/README.md +89 -0
- package/SKILL.md +38 -0
- package/dist/WindowContext-DybYtZJa.d.ts +50 -0
- package/dist/_styles-BbTx89aX.d.ts +3 -0
- package/dist/chunk-23KUNTRD.js +49 -0
- package/dist/chunk-23KUNTRD.js.map +1 -0
- package/dist/chunk-3RTSANKB.js +51 -0
- package/dist/chunk-3RTSANKB.js.map +1 -0
- package/dist/chunk-4QIWBOF4.js +129 -0
- package/dist/chunk-4QIWBOF4.js.map +1 -0
- package/dist/chunk-5JCWC7IU.js +293 -0
- package/dist/chunk-5JCWC7IU.js.map +1 -0
- package/dist/chunk-6ANDNGHD.js +33 -0
- package/dist/chunk-6ANDNGHD.js.map +1 -0
- package/dist/chunk-7W7QZHEZ.js +42 -0
- package/dist/chunk-7W7QZHEZ.js.map +1 -0
- package/dist/chunk-BHO4WT2N.js +51 -0
- package/dist/chunk-BHO4WT2N.js.map +1 -0
- package/dist/chunk-BI3KKBIC.js +11 -0
- package/dist/chunk-BI3KKBIC.js.map +1 -0
- package/dist/chunk-D3SP7GL3.js +55 -0
- package/dist/chunk-D3SP7GL3.js.map +1 -0
- package/dist/chunk-D7W4RSQX.js +115 -0
- package/dist/chunk-D7W4RSQX.js.map +1 -0
- package/dist/chunk-DN2AEEA2.js +11 -0
- package/dist/chunk-DN2AEEA2.js.map +1 -0
- package/dist/chunk-ETTKFCO6.js +84 -0
- package/dist/chunk-ETTKFCO6.js.map +1 -0
- package/dist/chunk-GJT7TDBS.js +66 -0
- package/dist/chunk-GJT7TDBS.js.map +1 -0
- package/dist/chunk-HZT6RQYZ.js +109 -0
- package/dist/chunk-HZT6RQYZ.js.map +1 -0
- package/dist/chunk-JB2QZV7K.js +60 -0
- package/dist/chunk-JB2QZV7K.js.map +1 -0
- package/dist/chunk-KJJB2PVC.js +21 -0
- package/dist/chunk-KJJB2PVC.js.map +1 -0
- package/dist/chunk-NE3IVPMO.js +31 -0
- package/dist/chunk-NE3IVPMO.js.map +1 -0
- package/dist/chunk-O2BG2KSY.js +23 -0
- package/dist/chunk-O2BG2KSY.js.map +1 -0
- package/dist/chunk-OUFGNJ3V.js +1726 -0
- package/dist/chunk-OUFGNJ3V.js.map +1 -0
- package/dist/chunk-PLZMCJSL.js +351 -0
- package/dist/chunk-PLZMCJSL.js.map +1 -0
- package/dist/chunk-POG5DZBT.js +104 -0
- package/dist/chunk-POG5DZBT.js.map +1 -0
- package/dist/chunk-SECZM6JE.js +170 -0
- package/dist/chunk-SECZM6JE.js.map +1 -0
- package/dist/chunk-T64WPXSC.js +48 -0
- package/dist/chunk-T64WPXSC.js.map +1 -0
- package/dist/chunk-TU5CYBB4.js +90 -0
- package/dist/chunk-TU5CYBB4.js.map +1 -0
- package/dist/chunk-UVAI2U6X.js +153 -0
- package/dist/chunk-UVAI2U6X.js.map +1 -0
- package/dist/chunk-UXCBLYG6.js +142 -0
- package/dist/chunk-UXCBLYG6.js.map +1 -0
- package/dist/chunk-VUR4MQMH.js +53 -0
- package/dist/chunk-VUR4MQMH.js.map +1 -0
- package/dist/chunk-WIEKNG4S.js +26 -0
- package/dist/chunk-WIEKNG4S.js.map +1 -0
- package/dist/chunk-WIZ4OLOB.js +23 -0
- package/dist/chunk-WIZ4OLOB.js.map +1 -0
- package/dist/chunk-WJRJBMFN.js +21 -0
- package/dist/chunk-WJRJBMFN.js.map +1 -0
- package/dist/chunk-YUPLJP3F.js +33 -0
- package/dist/chunk-YUPLJP3F.js.map +1 -0
- package/dist/chunk-Z7ITPSUF.js +184 -0
- package/dist/chunk-Z7ITPSUF.js.map +1 -0
- package/dist/chunk-ZC76ALSI.js +75 -0
- package/dist/chunk-ZC76ALSI.js.map +1 -0
- package/dist/code-block-core-xkE94Rk5.d.ts +30 -0
- package/dist/components/accordion.d.ts +9 -0
- package/dist/components/accordion.js +98 -0
- package/dist/components/accordion.js.map +1 -0
- package/dist/components/alert-dialog.d.ts +26 -0
- package/dist/components/alert-dialog.js +341 -0
- package/dist/components/alert-dialog.js.map +1 -0
- package/dist/components/alert.d.ts +13 -0
- package/dist/components/alert.js +76 -0
- package/dist/components/alert.js.map +1 -0
- package/dist/components/aspect-ratio.d.ts +6 -0
- package/dist/components/aspect-ratio.js +12 -0
- package/dist/components/aspect-ratio.js.map +1 -0
- package/dist/components/avatar.d.ts +13 -0
- package/dist/components/avatar.js +19 -0
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.d.ts +12 -0
- package/dist/components/badge.js +11 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +13 -0
- package/dist/components/breadcrumb.js +102 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/button-group.d.ts +16 -0
- package/dist/components/button-group.js +15 -0
- package/dist/components/button-group.js.map +1 -0
- package/dist/components/button.d.ts +14 -0
- package/dist/components/button.js +11 -0
- package/dist/components/button.js.map +1 -0
- package/dist/components/calendar.d.ts +14 -0
- package/dist/components/calendar.js +13 -0
- package/dist/components/calendar.js.map +1 -0
- package/dist/components/card.d.ts +13 -0
- package/dist/components/card.js +21 -0
- package/dist/components/card.js.map +1 -0
- package/dist/components/carousel.d.ts +32 -0
- package/dist/components/carousel.js +196 -0
- package/dist/components/carousel.js.map +1 -0
- package/dist/components/chart.d.ts +46 -0
- package/dist/components/chart.js +254 -0
- package/dist/components/chart.js.map +1 -0
- package/dist/components/checkbox.d.ts +6 -0
- package/dist/components/checkbox.js +41 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block-core.d.ts +3 -0
- package/dist/components/code-block-core.js +13 -0
- package/dist/components/code-block-core.js.map +1 -0
- package/dist/components/code-block-custom.d.ts +20 -0
- package/dist/components/code-block-custom.js +16 -0
- package/dist/components/code-block-custom.js.map +1 -0
- package/dist/components/code-block-shiki.d.ts +13 -0
- package/dist/components/code-block-shiki.js +15 -0
- package/dist/components/code-block-shiki.js.map +1 -0
- package/dist/components/code-block.d.ts +5 -0
- package/dist/components/code-block.js +14 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/collapsible.d.ts +8 -0
- package/dist/components/collapsible.js +24 -0
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/collection.d.ts +63 -0
- package/dist/components/collection.js +598 -0
- package/dist/components/collection.js.map +1 -0
- package/dist/components/color-dot.d.ts +19 -0
- package/dist/components/color-dot.js +41 -0
- package/dist/components/color-dot.js.map +1 -0
- package/dist/components/color-picker.d.ts +12 -0
- package/dist/components/color-picker.js +142 -0
- package/dist/components/color-picker.js.map +1 -0
- package/dist/components/combobox.d.ts +74 -0
- package/dist/components/combobox.js +610 -0
- package/dist/components/combobox.js.map +1 -0
- package/dist/components/command.d.ts +21 -0
- package/dist/components/command.js +31 -0
- package/dist/components/command.js.map +1 -0
- package/dist/components/date-picker.d.ts +43 -0
- package/dist/components/date-picker.js +235 -0
- package/dist/components/date-picker.js.map +1 -0
- package/dist/components/dialog.d.ts +25 -0
- package/dist/components/dialog.js +31 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +15 -0
- package/dist/components/drawer.js +124 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/dropdown-menu.d.ts +34 -0
- package/dist/components/dropdown-menu.js +248 -0
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/empty.d.ts +15 -0
- package/dist/components/empty.js +104 -0
- package/dist/components/empty.js.map +1 -0
- package/dist/components/field.d.ts +29 -0
- package/dist/components/field.js +214 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/format-bytes.d.ts +12 -0
- package/dist/components/format-bytes.js +30 -0
- package/dist/components/format-bytes.js.map +1 -0
- package/dist/components/format-number.d.ts +12 -0
- package/dist/components/format-number.js +30 -0
- package/dist/components/format-number.js.map +1 -0
- package/dist/components/gauge.d.ts +11 -0
- package/dist/components/gauge.js +82 -0
- package/dist/components/gauge.js.map +1 -0
- package/dist/components/hover-card.d.ts +8 -0
- package/dist/components/hover-card.js +45 -0
- package/dist/components/hover-card.js.map +1 -0
- package/dist/components/input-group.d.ts +24 -0
- package/dist/components/input-group.js +23 -0
- package/dist/components/input-group.js.map +1 -0
- package/dist/components/input-otp.d.ts +20 -0
- package/dist/components/input-otp.js +95 -0
- package/dist/components/input-otp.js.map +1 -0
- package/dist/components/input.d.ts +9 -0
- package/dist/components/input.js +9 -0
- package/dist/components/input.js.map +1 -0
- package/dist/components/item.d.ts +27 -0
- package/dist/components/item.js +182 -0
- package/dist/components/item.js.map +1 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +34 -0
- package/dist/components/kbd.js.map +1 -0
- package/dist/components/label.d.ts +6 -0
- package/dist/components/label.js +9 -0
- package/dist/components/label.js.map +1 -0
- package/dist/components/loading-bar.d.ts +8 -0
- package/dist/components/loading-bar.js +127 -0
- package/dist/components/loading-bar.js.map +1 -0
- package/dist/components/loading-dots.d.ts +5 -0
- package/dist/components/loading-dots.js +45 -0
- package/dist/components/loading-dots.js.map +1 -0
- package/dist/components/main-provider.d.ts +7 -0
- package/dist/components/main-provider.js +12 -0
- package/dist/components/main-provider.js.map +1 -0
- package/dist/components/mark.d.ts +11 -0
- package/dist/components/mark.js +44 -0
- package/dist/components/mark.js.map +1 -0
- package/dist/components/pagination.d.ts +21 -0
- package/dist/components/pagination.js +114 -0
- package/dist/components/pagination.js.map +1 -0
- package/dist/components/popover.d.ts +12 -0
- package/dist/components/popover.js +22 -0
- package/dist/components/popover.js.map +1 -0
- package/dist/components/prev-next-navigation.d.ts +15 -0
- package/dist/components/prev-next-navigation.js +85 -0
- package/dist/components/prev-next-navigation.js.map +1 -0
- package/dist/components/progress.d.ts +6 -0
- package/dist/components/progress.js +38 -0
- package/dist/components/progress.js.map +1 -0
- package/dist/components/radio-group.d.ts +7 -0
- package/dist/components/radio-group.js +57 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/relative-time.d.ts +16 -0
- package/dist/components/relative-time.js +75 -0
- package/dist/components/relative-time.js.map +1 -0
- package/dist/components/resizable.d.ts +10 -0
- package/dist/components/resizable.js +45 -0
- package/dist/components/resizable.js.map +1 -0
- package/dist/components/scroll-area.d.ts +7 -0
- package/dist/components/scroll-area.js +11 -0
- package/dist/components/scroll-area.js.map +1 -0
- package/dist/components/select.d.ts +20 -0
- package/dist/components/select.js +189 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/separator.d.ts +6 -0
- package/dist/components/separator.js +9 -0
- package/dist/components/separator.js.map +1 -0
- package/dist/components/sheet.d.ts +16 -0
- package/dist/components/sheet.js +25 -0
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/show-more.d.ts +15 -0
- package/dist/components/show-more.js +79 -0
- package/dist/components/show-more.js.map +1 -0
- package/dist/components/skeleton.d.ts +5 -0
- package/dist/components/skeleton.js +8 -0
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/slider.d.ts +6 -0
- package/dist/components/slider.js +65 -0
- package/dist/components/slider.js.map +1 -0
- package/dist/components/snippet.d.ts +13 -0
- package/dist/components/snippet.js +135 -0
- package/dist/components/snippet.js.map +1 -0
- package/dist/components/sonner.d.ts +6 -0
- package/dist/components/sonner.js +10 -0
- package/dist/components/sonner.js.map +1 -0
- package/dist/components/spinner.d.ts +5 -0
- package/dist/components/spinner.js +8 -0
- package/dist/components/spinner.js.map +1 -0
- package/dist/components/stat.d.ts +17 -0
- package/dist/components/stat.js +71 -0
- package/dist/components/stat.js.map +1 -0
- package/dist/components/steps.d.ts +17 -0
- package/dist/components/steps.js +133 -0
- package/dist/components/steps.js.map +1 -0
- package/dist/components/switch.d.ts +8 -0
- package/dist/components/switch.js +44 -0
- package/dist/components/switch.js.map +1 -0
- package/dist/components/table.d.ts +12 -0
- package/dist/components/table.js +101 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +14 -0
- package/dist/components/tabs.js +88 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/textarea.d.ts +5 -0
- package/dist/components/textarea.js +9 -0
- package/dist/components/textarea.js.map +1 -0
- package/dist/components/theme-provider.d.ts +10 -0
- package/dist/components/theme-provider.js +14 -0
- package/dist/components/theme-provider.js.map +1 -0
- package/dist/components/time-picker.d.ts +17 -0
- package/dist/components/time-picker.js +219 -0
- package/dist/components/time-picker.js.map +1 -0
- package/dist/components/timeline.d.ts +17 -0
- package/dist/components/timeline.js +138 -0
- package/dist/components/timeline.js.map +1 -0
- package/dist/components/toggle-group.d.ts +14 -0
- package/dist/components/toggle-group.js +82 -0
- package/dist/components/toggle-group.js.map +1 -0
- package/dist/components/toggle.d.ts +12 -0
- package/dist/components/toggle.js +11 -0
- package/dist/components/toggle.js.map +1 -0
- package/dist/components/tooltip.d.ts +9 -0
- package/dist/components/tooltip.js +15 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typography.d.ts +17 -0
- package/dist/components/typography.js +91 -0
- package/dist/components/typography.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +3 -0
- package/dist/hooks/use-mobile.js +7 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/hooks/use-theme.d.ts +3 -0
- package/dist/hooks/use-theme.js +8 -0
- package/dist/hooks/use-theme.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/center/index.d.ts +18 -0
- package/dist/layouts/center/index.js +73 -0
- package/dist/layouts/center/index.js.map +1 -0
- package/dist/layouts/chat/index.d.ts +42 -0
- package/dist/layouts/chat/index.js +191 -0
- package/dist/layouts/chat/index.js.map +1 -0
- package/dist/layouts/command/index.d.ts +2 -0
- package/dist/layouts/command/index.js +1 -0
- package/dist/layouts/command/index.js.map +1 -0
- package/dist/layouts/panel/index.d.ts +55 -0
- package/dist/layouts/panel/index.js +513 -0
- package/dist/layouts/panel/index.js.map +1 -0
- package/dist/layouts/presentation/index.d.ts +14 -0
- package/dist/layouts/presentation/index.js +100 -0
- package/dist/layouts/presentation/index.js.map +1 -0
- package/dist/layouts/site/index.d.ts +17 -0
- package/dist/layouts/site/index.js +82 -0
- package/dist/layouts/site/index.js.map +1 -0
- package/dist/layouts/window/index.d.ts +223 -0
- package/dist/layouts/window/index.js +127 -0
- package/dist/layouts/window/index.js.map +1 -0
- package/dist/layouts/workbench/index.d.ts +281 -0
- package/dist/layouts/workbench/index.js +2457 -0
- package/dist/layouts/workbench/index.js.map +1 -0
- package/dist/lib/format.d.ts +15 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/theme.d.ts +22 -0
- package/dist/lib/theme.js +25 -0
- package/dist/lib/theme.js.map +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +7 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles/fonts.css +1 -0
- package/dist/styles/globals.css +717 -0
- package/dist/styles/tokens.css +693 -0
- package/package.json +137 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
ThemeProvider,
|
|
4
|
+
useTheme
|
|
5
|
+
} from "../chunk-UXCBLYG6.js";
|
|
6
|
+
import {
|
|
7
|
+
getThemeInitScript
|
|
8
|
+
} from "../chunk-3RTSANKB.js";
|
|
9
|
+
export {
|
|
10
|
+
ThemeProvider,
|
|
11
|
+
getThemeInitScript,
|
|
12
|
+
useTheme
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=theme-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { F as FieldControlSize } from '../_styles-BbTx89aX.js';
|
|
3
|
+
|
|
4
|
+
type TimePickerHourCycle = "12" | "24";
|
|
5
|
+
type TimePickerPeriodLabel = "latin" | "korean";
|
|
6
|
+
type TimePickerProps = Omit<React.ComponentProps<"input">, "defaultValue" | "onChange" | "size" | "type" | "value"> & {
|
|
7
|
+
value?: string;
|
|
8
|
+
defaultValue?: string;
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
11
|
+
hourCycle?: TimePickerHourCycle;
|
|
12
|
+
periodLabel?: TimePickerPeriodLabel;
|
|
13
|
+
size?: FieldControlSize;
|
|
14
|
+
};
|
|
15
|
+
declare function TimePicker({ className, value, defaultValue, onValueChange, onChange, disabled, hourCycle, name, periodLabel, readOnly, size, step, ...props }: TimePickerProps): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { TimePicker, type TimePickerHourCycle, type TimePickerPeriodLabel, type TimePickerProps };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
InputGroup,
|
|
4
|
+
InputGroupAddon,
|
|
5
|
+
InputGroupInput
|
|
6
|
+
} from "../chunk-UVAI2U6X.js";
|
|
7
|
+
import "../chunk-NE3IVPMO.js";
|
|
8
|
+
import "../chunk-YUPLJP3F.js";
|
|
9
|
+
import "../chunk-TU5CYBB4.js";
|
|
10
|
+
import "../chunk-O2BG2KSY.js";
|
|
11
|
+
import "../chunk-DN2AEEA2.js";
|
|
12
|
+
|
|
13
|
+
// src/components/time-picker.tsx
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
import { Clock3Icon } from "lucide-react";
|
|
16
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
|
+
function getTimeParts(value) {
|
|
18
|
+
if (!value) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const match = value.trim().match(/^(\d{1,2}):(\d{2})(?::(\d{2}))?$/);
|
|
22
|
+
if (!match) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const hour = Number(match[1]);
|
|
26
|
+
const minute = Number(match[2]);
|
|
27
|
+
const second = match[3] === void 0 ? void 0 : Number(match[3]);
|
|
28
|
+
if (hour > 23 || minute > 59 || second !== void 0 && second > 59) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return { hour, minute, second };
|
|
32
|
+
}
|
|
33
|
+
function padTimePart(value) {
|
|
34
|
+
return value.toString().padStart(2, "0");
|
|
35
|
+
}
|
|
36
|
+
function serializeTimeValue({
|
|
37
|
+
hour,
|
|
38
|
+
minute,
|
|
39
|
+
second
|
|
40
|
+
}) {
|
|
41
|
+
const baseValue = `${padTimePart(hour)}:${padTimePart(minute)}`;
|
|
42
|
+
if (second === void 0) {
|
|
43
|
+
return baseValue;
|
|
44
|
+
}
|
|
45
|
+
return `${baseValue}:${padTimePart(second)}`;
|
|
46
|
+
}
|
|
47
|
+
function escapeRegExp(value) {
|
|
48
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
49
|
+
}
|
|
50
|
+
function parseTimeValue(value) {
|
|
51
|
+
const canonicalParts = getTimeParts(value);
|
|
52
|
+
if (canonicalParts) {
|
|
53
|
+
return serializeTimeValue(canonicalParts);
|
|
54
|
+
}
|
|
55
|
+
const periodLabels = [
|
|
56
|
+
{ period: "am", labels: ["am", "a.m.", "\uC624\uC804"] },
|
|
57
|
+
{ period: "pm", labels: ["pm", "p.m.", "\uC624\uD6C4"] }
|
|
58
|
+
];
|
|
59
|
+
const normalizedValue = value.trim().toLocaleLowerCase();
|
|
60
|
+
let period;
|
|
61
|
+
let valueWithoutPeriod = normalizedValue;
|
|
62
|
+
for (const candidate of periodLabels) {
|
|
63
|
+
const uniqueLabels = [...new Set(candidate.labels)];
|
|
64
|
+
const labelPattern = uniqueLabels.map((label) => escapeRegExp(label)).join("|");
|
|
65
|
+
const match2 = valueWithoutPeriod.match(new RegExp(`(^|\\s)(${labelPattern})(\\s|$)`));
|
|
66
|
+
if (match2?.[2]) {
|
|
67
|
+
period = candidate.period;
|
|
68
|
+
valueWithoutPeriod = valueWithoutPeriod.replace(match2[2], " ").trim();
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const match = valueWithoutPeriod.match(
|
|
73
|
+
/^(\d{1,2})(?::|시|\s)+(\d{1,2})(?:(?::|분|\s)+(\d{1,2}))?/
|
|
74
|
+
);
|
|
75
|
+
if (!match) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
let hour = Number(match[1]);
|
|
79
|
+
const minute = Number(match[2]);
|
|
80
|
+
const second = match[3] === void 0 ? void 0 : Number(match[3]);
|
|
81
|
+
if (period) {
|
|
82
|
+
if (hour < 1 || hour > 12) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
if (period === "am") {
|
|
86
|
+
hour = hour === 12 ? 0 : hour;
|
|
87
|
+
} else {
|
|
88
|
+
hour = hour === 12 ? 12 : hour + 12;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
const parts = getTimeParts(
|
|
92
|
+
`${hour}:${padTimePart(minute)}${second === void 0 ? "" : `:${padTimePart(second)}`}`
|
|
93
|
+
);
|
|
94
|
+
return parts ? serializeTimeValue(parts) : null;
|
|
95
|
+
}
|
|
96
|
+
var timePickerPeriodLabels = {
|
|
97
|
+
latin: {
|
|
98
|
+
am: "AM",
|
|
99
|
+
pm: "PM"
|
|
100
|
+
},
|
|
101
|
+
korean: {
|
|
102
|
+
am: "\uC624\uC804",
|
|
103
|
+
pm: "\uC624\uD6C4"
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
function formatTimeValue({
|
|
107
|
+
hourCycle,
|
|
108
|
+
periodLabel,
|
|
109
|
+
value
|
|
110
|
+
}) {
|
|
111
|
+
const parts = getTimeParts(value);
|
|
112
|
+
if (!parts) {
|
|
113
|
+
return "";
|
|
114
|
+
}
|
|
115
|
+
const secondPart = parts.second === void 0 ? "" : `:${padTimePart(parts.second)}`;
|
|
116
|
+
if (hourCycle === "24") {
|
|
117
|
+
return `${padTimePart(parts.hour)}:${padTimePart(parts.minute)}${secondPart}`;
|
|
118
|
+
}
|
|
119
|
+
const period = parts.hour < 12 ? "am" : "pm";
|
|
120
|
+
const hour = parts.hour % 12 || 12;
|
|
121
|
+
return `${timePickerPeriodLabels[periodLabel][period]} ${hour}:${padTimePart(parts.minute)}${secondPart}`;
|
|
122
|
+
}
|
|
123
|
+
function TimePicker({
|
|
124
|
+
className,
|
|
125
|
+
value,
|
|
126
|
+
defaultValue,
|
|
127
|
+
onValueChange,
|
|
128
|
+
onChange,
|
|
129
|
+
disabled,
|
|
130
|
+
hourCycle = "24",
|
|
131
|
+
name,
|
|
132
|
+
periodLabel = "latin",
|
|
133
|
+
readOnly,
|
|
134
|
+
size = "default",
|
|
135
|
+
step = 60,
|
|
136
|
+
...props
|
|
137
|
+
}) {
|
|
138
|
+
const isControlled = value !== void 0;
|
|
139
|
+
const [internalValue, setInternalValue] = React.useState(defaultValue ?? "");
|
|
140
|
+
const committedValue = isControlled ? value : internalValue;
|
|
141
|
+
const formattedValue = React.useMemo(
|
|
142
|
+
() => formatTimeValue({ hourCycle, periodLabel, value: committedValue }),
|
|
143
|
+
[committedValue, hourCycle, periodLabel]
|
|
144
|
+
);
|
|
145
|
+
const [draftValue, setDraftValue] = React.useState(formattedValue);
|
|
146
|
+
React.useEffect(() => {
|
|
147
|
+
setDraftValue(formattedValue);
|
|
148
|
+
}, [formattedValue]);
|
|
149
|
+
function updateValue(nextValue) {
|
|
150
|
+
if (readOnly) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (!isControlled) {
|
|
154
|
+
setInternalValue(nextValue);
|
|
155
|
+
}
|
|
156
|
+
if (nextValue !== committedValue) {
|
|
157
|
+
onValueChange?.(nextValue);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return /* @__PURE__ */ jsxs(
|
|
161
|
+
InputGroup,
|
|
162
|
+
{
|
|
163
|
+
"data-slot": "time-picker",
|
|
164
|
+
"data-disabled": disabled || void 0,
|
|
165
|
+
size,
|
|
166
|
+
className,
|
|
167
|
+
children: [
|
|
168
|
+
/* @__PURE__ */ jsx(
|
|
169
|
+
InputGroupInput,
|
|
170
|
+
{
|
|
171
|
+
...props,
|
|
172
|
+
type: "text",
|
|
173
|
+
value: draftValue,
|
|
174
|
+
disabled,
|
|
175
|
+
readOnly,
|
|
176
|
+
inputMode: hourCycle === "24" ? "numeric" : "text",
|
|
177
|
+
step,
|
|
178
|
+
onChange: (event) => {
|
|
179
|
+
const nextDraftValue = event.target.value;
|
|
180
|
+
const nextValue = parseTimeValue(nextDraftValue);
|
|
181
|
+
setDraftValue(nextDraftValue);
|
|
182
|
+
if (nextValue !== null) {
|
|
183
|
+
updateValue(nextValue);
|
|
184
|
+
}
|
|
185
|
+
onChange?.(event);
|
|
186
|
+
},
|
|
187
|
+
onBlur: (event) => {
|
|
188
|
+
const nextValue = parseTimeValue(event.target.value);
|
|
189
|
+
if (nextValue !== null) {
|
|
190
|
+
updateValue(nextValue);
|
|
191
|
+
setDraftValue(formatTimeValue({ hourCycle, periodLabel, value: nextValue }));
|
|
192
|
+
} else {
|
|
193
|
+
setDraftValue(formattedValue);
|
|
194
|
+
}
|
|
195
|
+
props.onBlur?.(event);
|
|
196
|
+
},
|
|
197
|
+
className: "appearance-none font-mono tabular-nums [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none"
|
|
198
|
+
}
|
|
199
|
+
),
|
|
200
|
+
name ? /* @__PURE__ */ jsx(
|
|
201
|
+
"input",
|
|
202
|
+
{
|
|
203
|
+
type: "hidden",
|
|
204
|
+
name,
|
|
205
|
+
value: committedValue,
|
|
206
|
+
form: props.form,
|
|
207
|
+
disabled,
|
|
208
|
+
readOnly: true
|
|
209
|
+
}
|
|
210
|
+
) : null,
|
|
211
|
+
/* @__PURE__ */ jsx(InputGroupAddon, { align: "inline-end", children: /* @__PURE__ */ jsx(Clock3Icon, { "aria-hidden": "true" }) })
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
export {
|
|
217
|
+
TimePicker
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=time-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/time-picker.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport { Clock3Icon } from \"lucide-react\"\n\nimport { InputGroup, InputGroupAddon, InputGroupInput } from \"@hyunsdev/ui/components/input-group\"\n\nimport type { FieldControlSize } from \"./_styles\"\n\ntype TimePickerHourCycle = \"12\" | \"24\"\ntype TimePickerPeriodLabel = \"latin\" | \"korean\"\n\ntype TimePickerProps = Omit<\n React.ComponentProps<\"input\">,\n \"defaultValue\" | \"onChange\" | \"size\" | \"type\" | \"value\"\n> & {\n value?: string\n defaultValue?: string\n onValueChange?: (value: string) => void\n onChange?: React.ChangeEventHandler<HTMLInputElement>\n hourCycle?: TimePickerHourCycle\n periodLabel?: TimePickerPeriodLabel\n size?: FieldControlSize\n}\n\nfunction getTimeParts(value: string | undefined) {\n if (!value) {\n return null\n }\n\n const match = value.trim().match(/^(\\d{1,2}):(\\d{2})(?::(\\d{2}))?$/)\n\n if (!match) {\n return null\n }\n\n const hour = Number(match[1])\n const minute = Number(match[2])\n const second = match[3] === undefined ? undefined : Number(match[3])\n\n if (hour > 23 || minute > 59 || (second !== undefined && second > 59)) {\n return null\n }\n\n return { hour, minute, second }\n}\n\nfunction padTimePart(value: number) {\n return value.toString().padStart(2, \"0\")\n}\n\nfunction serializeTimeValue({\n hour,\n minute,\n second,\n}: NonNullable<ReturnType<typeof getTimeParts>>) {\n const baseValue = `${padTimePart(hour)}:${padTimePart(minute)}`\n\n if (second === undefined) {\n return baseValue\n }\n\n return `${baseValue}:${padTimePart(second)}`\n}\n\nfunction escapeRegExp(value: string) {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\nfunction parseTimeValue(value: string) {\n const canonicalParts = getTimeParts(value)\n\n if (canonicalParts) {\n return serializeTimeValue(canonicalParts)\n }\n\n const periodLabels = [\n { period: \"am\", labels: [\"am\", \"a.m.\", \"오전\"] },\n { period: \"pm\", labels: [\"pm\", \"p.m.\", \"오후\"] },\n ] as const\n const normalizedValue = value.trim().toLocaleLowerCase()\n let period: (typeof periodLabels)[number][\"period\"] | undefined\n let valueWithoutPeriod = normalizedValue\n\n for (const candidate of periodLabels) {\n const uniqueLabels = [...new Set(candidate.labels)]\n const labelPattern = uniqueLabels.map((label) => escapeRegExp(label)).join(\"|\")\n const match = valueWithoutPeriod.match(new RegExp(`(^|\\\\s)(${labelPattern})(\\\\s|$)`))\n\n if (match?.[2]) {\n period = candidate.period\n valueWithoutPeriod = valueWithoutPeriod.replace(match[2], \" \").trim()\n break\n }\n }\n\n const match = valueWithoutPeriod.match(\n /^(\\d{1,2})(?::|시|\\s)+(\\d{1,2})(?:(?::|분|\\s)+(\\d{1,2}))?/,\n )\n\n if (!match) {\n return null\n }\n\n let hour = Number(match[1])\n const minute = Number(match[2])\n const second = match[3] === undefined ? undefined : Number(match[3])\n\n if (period) {\n if (hour < 1 || hour > 12) {\n return null\n }\n\n if (period === \"am\") {\n hour = hour === 12 ? 0 : hour\n } else {\n hour = hour === 12 ? 12 : hour + 12\n }\n }\n\n const parts = getTimeParts(\n `${hour}:${padTimePart(minute)}${second === undefined ? \"\" : `:${padTimePart(second)}`}`,\n )\n\n return parts ? serializeTimeValue(parts) : null\n}\n\nconst timePickerPeriodLabels = {\n latin: {\n am: \"AM\",\n pm: \"PM\",\n },\n korean: {\n am: \"오전\",\n pm: \"오후\",\n },\n} as const satisfies Record<TimePickerPeriodLabel, Record<\"am\" | \"pm\", string>>\n\nfunction formatTimeValue({\n hourCycle,\n periodLabel,\n value,\n}: {\n hourCycle: TimePickerHourCycle\n periodLabel: TimePickerPeriodLabel\n value: string | undefined\n}) {\n const parts = getTimeParts(value)\n\n if (!parts) {\n return \"\"\n }\n\n const secondPart = parts.second === undefined ? \"\" : `:${padTimePart(parts.second)}`\n\n if (hourCycle === \"24\") {\n return `${padTimePart(parts.hour)}:${padTimePart(parts.minute)}${secondPart}`\n }\n\n const period = parts.hour < 12 ? \"am\" : \"pm\"\n const hour = parts.hour % 12 || 12\n\n return `${timePickerPeriodLabels[periodLabel][period]} ${hour}:${padTimePart(parts.minute)}${secondPart}`\n}\n\nfunction TimePicker({\n className,\n value,\n defaultValue,\n onValueChange,\n onChange,\n disabled,\n hourCycle = \"24\",\n name,\n periodLabel = \"latin\",\n readOnly,\n size = \"default\",\n step = 60,\n ...props\n}: TimePickerProps) {\n const isControlled = value !== undefined\n const [internalValue, setInternalValue] = React.useState(defaultValue ?? \"\")\n const committedValue = isControlled ? value : internalValue\n const formattedValue = React.useMemo(\n () => formatTimeValue({ hourCycle, periodLabel, value: committedValue }),\n [committedValue, hourCycle, periodLabel],\n )\n const [draftValue, setDraftValue] = React.useState(formattedValue)\n\n React.useEffect(() => {\n setDraftValue(formattedValue)\n }, [formattedValue])\n\n function updateValue(nextValue: string) {\n if (readOnly) {\n return\n }\n\n if (!isControlled) {\n setInternalValue(nextValue)\n }\n\n if (nextValue !== committedValue) {\n onValueChange?.(nextValue)\n }\n }\n\n return (\n <InputGroup\n data-slot=\"time-picker\"\n data-disabled={disabled || undefined}\n size={size}\n className={className}\n >\n <InputGroupInput\n {...props}\n type=\"text\"\n value={draftValue}\n disabled={disabled}\n readOnly={readOnly}\n inputMode={hourCycle === \"24\" ? \"numeric\" : \"text\"}\n step={step}\n onChange={(event) => {\n const nextDraftValue = event.target.value\n const nextValue = parseTimeValue(nextDraftValue)\n\n setDraftValue(nextDraftValue)\n\n if (nextValue !== null) {\n updateValue(nextValue)\n }\n\n onChange?.(event)\n }}\n onBlur={(event) => {\n const nextValue = parseTimeValue(event.target.value)\n\n if (nextValue !== null) {\n updateValue(nextValue)\n setDraftValue(formatTimeValue({ hourCycle, periodLabel, value: nextValue }))\n } else {\n setDraftValue(formattedValue)\n }\n\n props.onBlur?.(event)\n }}\n className=\"appearance-none font-mono tabular-nums [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none\"\n />\n {name ? (\n <input\n type=\"hidden\"\n name={name}\n value={committedValue}\n form={props.form}\n disabled={disabled}\n readOnly\n />\n ) : null}\n <InputGroupAddon align=\"inline-end\">\n <Clock3Icon aria-hidden=\"true\" />\n </InputGroupAddon>\n </InputGroup>\n )\n}\n\nexport { TimePicker, type TimePickerHourCycle, type TimePickerPeriodLabel, type TimePickerProps }\n"],"mappings":";;;;;;;;;;;;;AAEA,YAAY,WAAW;AAEvB,SAAS,kBAAkB;AA6MvB,SAME,KANF;AAvLJ,SAAS,aAAa,OAA2B;AAC/C,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,QAAM,QAAQ,MAAM,KAAK,EAAE,MAAM,kCAAkC;AAEnE,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,OAAO,MAAM,CAAC,CAAC;AAC5B,QAAM,SAAS,OAAO,MAAM,CAAC,CAAC;AAC9B,QAAM,SAAS,MAAM,CAAC,MAAM,SAAY,SAAY,OAAO,MAAM,CAAC,CAAC;AAEnE,MAAI,OAAO,MAAM,SAAS,MAAO,WAAW,UAAa,SAAS,IAAK;AACrE,WAAO;AAAA,EACT;AAEA,SAAO,EAAE,MAAM,QAAQ,OAAO;AAChC;AAEA,SAAS,YAAY,OAAe;AAClC,SAAO,MAAM,SAAS,EAAE,SAAS,GAAG,GAAG;AACzC;AAEA,SAAS,mBAAmB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AACF,GAAiD;AAC/C,QAAM,YAAY,GAAG,YAAY,IAAI,CAAC,IAAI,YAAY,MAAM,CAAC;AAE7D,MAAI,WAAW,QAAW;AACxB,WAAO;AAAA,EACT;AAEA,SAAO,GAAG,SAAS,IAAI,YAAY,MAAM,CAAC;AAC5C;AAEA,SAAS,aAAa,OAAe;AACnC,SAAO,MAAM,QAAQ,uBAAuB,MAAM;AAC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AAA,YACP,MAAM,MAAM;AAAA,YACZ;AAAA,YACA,UAAQ;AAAA;AAAA,QACV,IACE;AAAA,QACJ,oBAAC,mBAAgB,OAAM,cACrB,8BAAC,cAAW,eAAY,QAAO,GACjC;AAAA;AAAA;AAAA,EACF;AAEJ;","names":["match"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type TimelineItemState = "default" | "completed" | "current" | "error" | "muted";
|
|
4
|
+
declare function Timeline({ className, ...props }: React.ComponentProps<"ol">): React.JSX.Element;
|
|
5
|
+
declare function TimelineItem({ className, state, ...props }: React.ComponentProps<"li"> & {
|
|
6
|
+
state?: TimelineItemState;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
declare function TimelineSeparator({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function TimelineDot({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
10
|
+
declare function TimelineConnector({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
|
11
|
+
declare function TimelineContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
12
|
+
declare function TimelineHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
13
|
+
declare function TimelineTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
14
|
+
declare function TimelineDescription({ className, ...props }: React.ComponentProps<"p">): React.JSX.Element;
|
|
15
|
+
declare function TimelineTime({ className, ...props }: React.ComponentProps<"time">): React.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { Timeline, TimelineConnector, TimelineContent, TimelineDescription, TimelineDot, TimelineHeader, TimelineItem, type TimelineItemState, TimelineSeparator, TimelineTime, TimelineTitle };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn
|
|
3
|
+
} from "../chunk-DN2AEEA2.js";
|
|
4
|
+
|
|
5
|
+
// src/components/timeline.tsx
|
|
6
|
+
import "react";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function Timeline({ className, ...props }) {
|
|
9
|
+
return /* @__PURE__ */ jsx("ol", { "data-slot": "timeline", className: cn("flex w-full flex-col", className), ...props });
|
|
10
|
+
}
|
|
11
|
+
function TimelineItem({
|
|
12
|
+
className,
|
|
13
|
+
state = "default",
|
|
14
|
+
...props
|
|
15
|
+
}) {
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
17
|
+
"li",
|
|
18
|
+
{
|
|
19
|
+
"data-slot": "timeline-item",
|
|
20
|
+
"data-state": state,
|
|
21
|
+
className: cn(
|
|
22
|
+
"group/timeline-item grid grid-cols-[1rem_minmax(0,1fr)] gap-x-3 [&:last-child_[data-slot=timeline-connector]]:hidden [&:last-child_[data-slot=timeline-content]]:pb-0",
|
|
23
|
+
className
|
|
24
|
+
),
|
|
25
|
+
...props
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function TimelineSeparator({ className, ...props }) {
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
"data-slot": "timeline-separator",
|
|
34
|
+
className: cn("flex flex-col items-center", className),
|
|
35
|
+
...props
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
function TimelineDot({ className, ...props }) {
|
|
40
|
+
return /* @__PURE__ */ jsx(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
"data-slot": "timeline-dot",
|
|
44
|
+
className: cn(
|
|
45
|
+
"border-border bg-background-primary mt-1 flex size-2.5 shrink-0 rounded-full border transition-colors",
|
|
46
|
+
"group-data-[state=completed]/timeline-item:border-interactive-accent group-data-[state=completed]/timeline-item:bg-interactive-accent",
|
|
47
|
+
"group-data-[state=current]/timeline-item:border-interactive-accent group-data-[state=current]/timeline-item:bg-background-primary",
|
|
48
|
+
"group-data-[state=error]/timeline-item:bg-background-error",
|
|
49
|
+
"group-data-[state=muted]/timeline-item:bg-background-secondary",
|
|
50
|
+
className
|
|
51
|
+
),
|
|
52
|
+
...props
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function TimelineConnector({ className, ...props }) {
|
|
57
|
+
return /* @__PURE__ */ jsx(
|
|
58
|
+
"span",
|
|
59
|
+
{
|
|
60
|
+
"data-slot": "timeline-connector",
|
|
61
|
+
className: cn(
|
|
62
|
+
"bg-border mt-1 min-h-6 w-px flex-1 transition-colors",
|
|
63
|
+
"group-data-[state=completed]/timeline-item:bg-interactive-accent",
|
|
64
|
+
"group-data-[state=error]/timeline-item:bg-background-error",
|
|
65
|
+
className
|
|
66
|
+
),
|
|
67
|
+
...props
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
function TimelineContent({ className, ...props }) {
|
|
72
|
+
return /* @__PURE__ */ jsx(
|
|
73
|
+
"div",
|
|
74
|
+
{
|
|
75
|
+
"data-slot": "timeline-content",
|
|
76
|
+
className: cn("flex min-w-0 flex-col gap-1 pb-6", className),
|
|
77
|
+
...props
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
function TimelineHeader({ className, ...props }) {
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
"div",
|
|
84
|
+
{
|
|
85
|
+
"data-slot": "timeline-header",
|
|
86
|
+
className: cn("flex min-w-0 items-start gap-2", className),
|
|
87
|
+
...props
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
function TimelineTitle({ className, ...props }) {
|
|
92
|
+
return /* @__PURE__ */ jsx(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
"data-slot": "timeline-title",
|
|
96
|
+
className: cn(
|
|
97
|
+
"text-text-normal text-sm leading-snug font-medium",
|
|
98
|
+
"group-data-[state=muted]/timeline-item:text-text-muted",
|
|
99
|
+
"group-data-[state=error]/timeline-item:text-text-error",
|
|
100
|
+
className
|
|
101
|
+
),
|
|
102
|
+
...props
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function TimelineDescription({ className, ...props }) {
|
|
107
|
+
return /* @__PURE__ */ jsx(
|
|
108
|
+
"p",
|
|
109
|
+
{
|
|
110
|
+
"data-slot": "timeline-description",
|
|
111
|
+
className: cn("text-text-muted text-sm leading-normal", className),
|
|
112
|
+
...props
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
function TimelineTime({ className, ...props }) {
|
|
117
|
+
return /* @__PURE__ */ jsx(
|
|
118
|
+
"time",
|
|
119
|
+
{
|
|
120
|
+
"data-slot": "timeline-time",
|
|
121
|
+
className: cn("text-text-muted shrink-0 text-xs leading-5 tabular-nums", className),
|
|
122
|
+
...props
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
Timeline,
|
|
128
|
+
TimelineConnector,
|
|
129
|
+
TimelineContent,
|
|
130
|
+
TimelineDescription,
|
|
131
|
+
TimelineDot,
|
|
132
|
+
TimelineHeader,
|
|
133
|
+
TimelineItem,
|
|
134
|
+
TimelineSeparator,
|
|
135
|
+
TimelineTime,
|
|
136
|
+
TimelineTitle
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/timeline.tsx"],"sourcesContent":["import * as React from \"react\"\n\nimport { cn } from \"@hyunsdev/ui/lib/utils\"\n\ntype TimelineItemState = \"default\" | \"completed\" | \"current\" | \"error\" | \"muted\"\n\nfunction Timeline({ className, ...props }: React.ComponentProps<\"ol\">) {\n return <ol data-slot=\"timeline\" className={cn(\"flex w-full flex-col\", className)} {...props} />\n}\n\nfunction TimelineItem({\n className,\n state = \"default\",\n ...props\n}: React.ComponentProps<\"li\"> & { state?: TimelineItemState }) {\n return (\n <li\n data-slot=\"timeline-item\"\n data-state={state}\n className={cn(\n \"group/timeline-item grid grid-cols-[1rem_minmax(0,1fr)] gap-x-3 [&:last-child_[data-slot=timeline-connector]]:hidden [&:last-child_[data-slot=timeline-content]]:pb-0\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction TimelineSeparator({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"timeline-separator\"\n className={cn(\"flex flex-col items-center\", className)}\n {...props}\n />\n )\n}\n\nfunction TimelineDot({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"timeline-dot\"\n className={cn(\n \"border-border bg-background-primary mt-1 flex size-2.5 shrink-0 rounded-full border transition-colors\",\n \"group-data-[state=completed]/timeline-item:border-interactive-accent group-data-[state=completed]/timeline-item:bg-interactive-accent\",\n \"group-data-[state=current]/timeline-item:border-interactive-accent group-data-[state=current]/timeline-item:bg-background-primary\",\n \"group-data-[state=error]/timeline-item:bg-background-error\",\n \"group-data-[state=muted]/timeline-item:bg-background-secondary\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction TimelineConnector({ className, ...props }: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"timeline-connector\"\n className={cn(\n \"bg-border mt-1 min-h-6 w-px flex-1 transition-colors\",\n \"group-data-[state=completed]/timeline-item:bg-interactive-accent\",\n \"group-data-[state=error]/timeline-item:bg-background-error\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction TimelineContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"timeline-content\"\n className={cn(\"flex min-w-0 flex-col gap-1 pb-6\", className)}\n {...props}\n />\n )\n}\n\nfunction TimelineHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"timeline-header\"\n className={cn(\"flex min-w-0 items-start gap-2\", className)}\n {...props}\n />\n )\n}\n\nfunction TimelineTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"timeline-title\"\n className={cn(\n \"text-text-normal text-sm leading-snug font-medium\",\n \"group-data-[state=muted]/timeline-item:text-text-muted\",\n \"group-data-[state=error]/timeline-item:text-text-error\",\n className,\n )}\n {...props}\n />\n )\n}\n\nfunction TimelineDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <p\n data-slot=\"timeline-description\"\n className={cn(\"text-text-muted text-sm leading-normal\", className)}\n {...props}\n />\n )\n}\n\nfunction TimelineTime({ className, ...props }: React.ComponentProps<\"time\">) {\n return (\n <time\n data-slot=\"timeline-time\"\n className={cn(\"text-text-muted shrink-0 text-xs leading-5 tabular-nums\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Timeline,\n TimelineItem,\n TimelineSeparator,\n TimelineDot,\n TimelineConnector,\n TimelineContent,\n TimelineHeader,\n TimelineTitle,\n TimelineDescription,\n TimelineTime,\n type TimelineItemState,\n}\n"],"mappings":";;;;;AAAA,OAAuB;AAOd;AADT,SAAS,SAAS,EAAE,WAAW,GAAG,MAAM,GAA+B;AACrE,SAAO,oBAAC,QAAG,aAAU,YAAW,WAAW,GAAG,wBAAwB,SAAS,GAAI,GAAG,OAAO;AAC/F;AAEA,SAAS,aAAa;AAAA,EACpB;AAAA,EACA,QAAQ;AAAA,EACR,GAAG;AACL,GAA+D;AAC7D,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,cAAY;AAAA,MACZ,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,kBAAkB,EAAE,WAAW,GAAG,MAAM,GAAgC;AAC/E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,8BAA8B,SAAS;AAAA,MACpD,GAAG;AAAA;AAAA,EACN;AAEJ;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,MAAM,GAAiC;AAC1E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,Q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J;","names":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
3
|
+
import { VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { toggleVariants } from './toggle.js';
|
|
5
|
+
import 'class-variance-authority/types';
|
|
6
|
+
import '@radix-ui/react-toggle';
|
|
7
|
+
|
|
8
|
+
declare function ToggleGroup({ className, variant, size, spacing, orientation, children, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants> & {
|
|
9
|
+
spacing?: number;
|
|
10
|
+
orientation?: "horizontal" | "vertical";
|
|
11
|
+
}): React.JSX.Element;
|
|
12
|
+
declare function ToggleGroupItem({ className, children, variant, size, ...props }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
13
|
+
|
|
14
|
+
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
toggleVariants
|
|
4
|
+
} from "../chunk-BHO4WT2N.js";
|
|
5
|
+
import {
|
|
6
|
+
cn
|
|
7
|
+
} from "../chunk-DN2AEEA2.js";
|
|
8
|
+
|
|
9
|
+
// src/components/toggle-group.tsx
|
|
10
|
+
import * as React from "react";
|
|
11
|
+
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
12
|
+
import "class-variance-authority";
|
|
13
|
+
import { jsx } from "react/jsx-runtime";
|
|
14
|
+
var ToggleGroupContext = React.createContext({
|
|
15
|
+
size: "default",
|
|
16
|
+
variant: "ghost",
|
|
17
|
+
spacing: 0,
|
|
18
|
+
orientation: "horizontal"
|
|
19
|
+
});
|
|
20
|
+
function ToggleGroup({
|
|
21
|
+
className,
|
|
22
|
+
variant,
|
|
23
|
+
size,
|
|
24
|
+
spacing = 0,
|
|
25
|
+
orientation = "horizontal",
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
29
|
+
const toggleGroupStyle = {
|
|
30
|
+
"--gap": spacing
|
|
31
|
+
};
|
|
32
|
+
return /* @__PURE__ */ jsx(
|
|
33
|
+
ToggleGroupPrimitive.Root,
|
|
34
|
+
{
|
|
35
|
+
"data-slot": "toggle-group",
|
|
36
|
+
"data-variant": variant,
|
|
37
|
+
"data-size": size,
|
|
38
|
+
"data-spacing": spacing,
|
|
39
|
+
"data-orientation": orientation,
|
|
40
|
+
style: toggleGroupStyle,
|
|
41
|
+
className: cn(
|
|
42
|
+
"group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-vertical:flex-col data-vertical:items-stretch data-[size=sm]:rounded-[min(var(--radius-md),10px)]",
|
|
43
|
+
className
|
|
44
|
+
),
|
|
45
|
+
...props,
|
|
46
|
+
children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size, spacing, orientation }, children })
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
function ToggleGroupItem({
|
|
51
|
+
className,
|
|
52
|
+
children,
|
|
53
|
+
variant = "normal",
|
|
54
|
+
size = "default",
|
|
55
|
+
...props
|
|
56
|
+
}) {
|
|
57
|
+
const context = React.useContext(ToggleGroupContext);
|
|
58
|
+
return /* @__PURE__ */ jsx(
|
|
59
|
+
ToggleGroupPrimitive.Item,
|
|
60
|
+
{
|
|
61
|
+
"data-slot": "toggle-group-item",
|
|
62
|
+
"data-variant": context.variant || variant,
|
|
63
|
+
"data-size": context.size || size,
|
|
64
|
+
"data-spacing": context.spacing,
|
|
65
|
+
className: cn(
|
|
66
|
+
"shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",
|
|
67
|
+
toggleVariants({
|
|
68
|
+
variant: context.variant || variant,
|
|
69
|
+
size: context.size || size
|
|
70
|
+
}),
|
|
71
|
+
className
|
|
72
|
+
),
|
|
73
|
+
...props,
|
|
74
|
+
children
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
export {
|
|
79
|
+
ToggleGroup,
|
|
80
|
+
ToggleGroupItem
|
|
81
|
+
};
|
|
82
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/components/toggle-group.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\n\nimport * as ToggleGroupPrimitive from \"@radix-ui/react-toggle-group\"\nimport { type VariantProps } from \"class-variance-authority\"\n\nimport { toggleVariants } from \"@hyunsdev/ui/components/toggle\"\nimport { cn } from \"@hyunsdev/ui/lib/utils\"\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants> & {\n spacing?: number\n orientation?: \"horizontal\" | \"vertical\"\n }\n>({\n size: \"default\",\n variant: \"ghost\",\n spacing: 0,\n orientation: \"horizontal\",\n})\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n spacing = 0,\n orientation = \"horizontal\",\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants> & {\n spacing?: number\n orientation?: \"horizontal\" | \"vertical\"\n }) {\n const toggleGroupStyle = {\n \"--gap\": spacing,\n } satisfies React.CSSProperties & {\n readonly \"--gap\": number\n }\n\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n data-spacing={spacing}\n data-orientation={orientation}\n style={toggleGroupStyle}\n className={cn(\n \"group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-vertical:flex-col data-vertical:items-stretch data-[size=sm]:rounded-[min(var(--radius-md),10px)]\",\n className,\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size, spacing, orientation }}>\n {children}\n </ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n )\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant = \"normal\",\n size = \"default\",\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext)\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n data-spacing={context.spacing}\n className={cn(\n \"shrink-0 group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 focus:z-10 focus-visible:z-10 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-end]:pr-1.5 group-data-[spacing=0]/toggle-group:has-data-[icon=inline-start]:pl-1.5 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t\",\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className,\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n )\n}\n\nexport { ToggleGroup, ToggleGroupItem }\n"],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAEvB,YAAY,0BAA0B;AACtC,OAAkC;AAkD5B;AA7CN,IAAM,qBAA2B,oBAK/B;AAAA,EACA,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,aAAa;AACf,CAAC;AAED,SAAS,YAAY;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,cAAc;AAAA,EACd;AAAA,EACA,GAAG;AACL,GAIK;AACH,QAAM,mBAAmB;AAAA,IACvB,SAAS;AAAA,EACX;AAIA,SACE;AAAA,IAAsB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,gBAAc;AAAA,MACd,aAAW;AAAA,MACX,gBAAc;AAAA,MACd,oBAAkB;AAAA,MAClB,OAAO;AAAA,MACP,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEJ,8BAAC,mBAAmB,UAAnB,EAA4B,OAAO,EAAE,SAAS,MAAM,SAAS,YAAY,GACvE,UACH;AAAA;AAAA,EACF;AAEJ;AAEA,SAAS,gBAAgB;AAAA,EACvB;AAAA,EACA;AAAA,EACA,UAAU;AAAA,EACV,OAAO;AAAA,EACP,GAAG;AACL,GAAiG;AAC/F,QAAM,UAAgB,iBAAW,kBAAkB;AAEnD,SACE;AAAA,IAAsB;AAAA,IAArB;AAAA,MACC,aAAU;AAAA,MACV,gBAAc,QAAQ,WAAW;AAAA,MACjC,aAAW,QAAQ,QAAQ;AAAA,MAC3B,gBAAc,QAAQ;AAAA,MACtB,WAAW;AAAA,QACT;AAAA,QACA,eAAe;AAAA,UACb,SAAS,QAAQ,WAAW;AAAA,UAC5B,MAAM,QAAQ,QAAQ;AAAA,QACxB,CAAC;AAAA,QACD;AAAA,MACF;AAAA,MACC,GAAG;AAAA,MAEH;AAAA;AAAA,EACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
4
|
+
import { VariantProps } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
declare const toggleVariants: (props?: ({
|
|
7
|
+
variant?: "normal" | "outline" | "ghost" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | "lg" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare function Toggle({ className, variant, size, ...props }: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>): React.JSX.Element;
|
|
11
|
+
|
|
12
|
+
export { Toggle, toggleVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
|
|
4
|
+
declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): React.JSX.Element;
|
|
5
|
+
declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): React.JSX.Element;
|
|
6
|
+
declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): React.JSX.Element;
|
|
7
|
+
declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): React.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Tooltip,
|
|
4
|
+
TooltipContent,
|
|
5
|
+
TooltipProvider,
|
|
6
|
+
TooltipTrigger
|
|
7
|
+
} from "../chunk-D3SP7GL3.js";
|
|
8
|
+
import "../chunk-DN2AEEA2.js";
|
|
9
|
+
export {
|
|
10
|
+
Tooltip,
|
|
11
|
+
TooltipContent,
|
|
12
|
+
TooltipProvider,
|
|
13
|
+
TooltipTrigger
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
declare function H1({ className, ...props }: React.ComponentPropsWithRef<"h1">): React$1.JSX.Element;
|
|
4
|
+
declare function H2({ className, ...props }: React.ComponentPropsWithRef<"h2">): React$1.JSX.Element;
|
|
5
|
+
declare function H3({ className, ...props }: React.ComponentPropsWithRef<"h3">): React$1.JSX.Element;
|
|
6
|
+
declare function H4({ className, ...props }: React.ComponentPropsWithRef<"h4">): React$1.JSX.Element;
|
|
7
|
+
declare function P({ className, ...props }: React.ComponentPropsWithRef<"p">): React$1.JSX.Element;
|
|
8
|
+
declare function Blockquote({ className, ...props }: React.ComponentPropsWithRef<"blockquote">): React$1.JSX.Element;
|
|
9
|
+
declare function Ul({ className, ...props }: React.ComponentPropsWithRef<"ul">): React$1.JSX.Element;
|
|
10
|
+
declare function InlineCode({ className, ...props }: React.ComponentPropsWithRef<"code">): React$1.JSX.Element;
|
|
11
|
+
declare function Lead({ className, ...props }: React.ComponentPropsWithRef<"p">): React$1.JSX.Element;
|
|
12
|
+
declare function Large({ className, ...props }: React.ComponentPropsWithRef<"p">): React$1.JSX.Element;
|
|
13
|
+
declare function Small({ className, ...props }: React.ComponentPropsWithRef<"small">): React$1.JSX.Element;
|
|
14
|
+
declare function Muted({ className, ...props }: React.ComponentPropsWithRef<"p">): React$1.JSX.Element;
|
|
15
|
+
declare function A({ className, ...props }: React.ComponentPropsWithRef<"a">): React$1.JSX.Element;
|
|
16
|
+
|
|
17
|
+
export { A, Blockquote, H1, H2, H3, H4, InlineCode, Large, Lead, Muted, P, Small, Ul };
|