@k8o/arte-odyssey 8.0.3 → 9.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/dist/components/buttons/button/button.d.mts +1 -1
- package/dist/components/buttons/button/button.mjs +1 -1
- package/dist/components/buttons/icon-button/icon-button.d.mts +1 -1
- package/dist/components/buttons/icon-button/icon-button.mjs +5 -16
- package/dist/components/data-display/accordion/accordion-button.mjs +2 -2
- package/dist/components/data-display/accordion/accordion-item.mjs +4 -1
- package/dist/components/data-display/accordion/accordion.mjs +1 -1
- package/dist/components/data-display/accordion/context.d.mts +1 -1
- package/dist/components/data-display/accordion/context.mjs +3 -12
- package/dist/components/data-display/avatar/avatar.d.mts +1 -1
- package/dist/components/data-display/avatar/avatar.mjs +2 -2
- package/dist/components/data-display/badge/badge.d.mts +1 -1
- package/dist/components/data-display/badge/badge.mjs +3 -3
- package/dist/components/data-display/card/card.mjs +2 -2
- package/dist/components/data-display/card/interactive-card.mjs +2 -2
- package/dist/components/data-display/card/type.d.mts +1 -1
- package/dist/components/data-display/code/code.d.mts +1 -1
- package/dist/components/data-display/code/code.mjs +4 -5
- package/dist/{helpers/color → components/data-display/code}/find-all-colors.d.mts +1 -1
- package/dist/{helpers/color → components/data-display/code}/find-all-colors.mjs +1 -1
- package/dist/components/data-display/heading/heading.d.mts +1 -1
- package/dist/components/data-display/heading/heading.mjs +7 -7
- package/dist/components/data-display/table/table.d.mts +12 -17
- package/dist/components/data-display/table/table.mjs +23 -21
- package/dist/components/feedback/alert/alert.d.mts +1 -1
- package/dist/components/feedback/alert/alert.mjs +2 -2
- package/dist/components/feedback/progress/progress.d.mts +1 -1
- package/dist/components/feedback/progress/progress.mjs +6 -7
- package/dist/components/feedback/skeleton/skeleton.d.mts +1 -1
- package/dist/components/feedback/skeleton/skeleton.mjs +2 -2
- package/dist/components/feedback/spinner/spinner.d.mts +1 -1
- package/dist/components/feedback/spinner/spinner.mjs +2 -2
- package/dist/components/feedback/toast/context.d.mts +2 -2
- package/dist/components/feedback/toast/context.mjs +6 -7
- package/dist/components/feedback/toast/provider.mjs +1 -1
- package/dist/components/form/autocomplete/autocomplete.d.mts +1 -1
- package/dist/components/form/autocomplete/autocomplete.mjs +75 -51
- package/dist/components/form/checkbox/checkbox.d.mts +1 -1
- package/dist/components/form/checkbox/checkbox.mjs +7 -4
- package/dist/components/form/checkbox-card/checkbox-card.d.mts +1 -1
- package/dist/components/form/checkbox-card/checkbox-card.mjs +10 -9
- package/dist/components/form/checkbox-group/checkbox-group.d.mts +1 -1
- package/dist/components/form/checkbox-group/index.d.mts +3 -3
- package/dist/components/form/file-field/file-field.d.mts +1 -1
- package/dist/components/form/file-field/file-field.mjs +4 -10
- package/dist/components/form/form/form.d.mts +1 -1
- package/dist/components/form/form/form.mjs +2 -3
- package/dist/{helpers/number → components/form/number-field}/cast.d.mts +1 -1
- package/dist/{helpers/number → components/form/number-field}/cast.mjs +2 -2
- package/dist/components/form/number-field/number-field.d.mts +1 -1
- package/dist/components/form/number-field/number-field.mjs +25 -24
- package/dist/components/form/password-input/password-input.d.mts +1 -1
- package/dist/components/form/password-input/password-input.mjs +3 -3
- package/dist/components/form/radio/radio.d.mts +1 -1
- package/dist/components/form/radio/radio.mjs +6 -4
- package/dist/components/form/radio-card/radio-card.d.mts +1 -1
- package/dist/components/form/radio-card/radio-card.mjs +11 -8
- package/dist/components/form/select/select.d.mts +1 -1
- package/dist/components/form/select/select.mjs +5 -4
- package/dist/components/form/slider/slider.d.mts +1 -1
- package/dist/components/form/slider/slider.mjs +15 -8
- package/dist/components/form/switch/switch.d.mts +1 -1
- package/dist/components/form/switch/switch.mjs +9 -6
- package/dist/components/form/text-field/text-field.d.mts +1 -1
- package/dist/components/form/text-field/text-field.mjs +1 -1
- package/dist/components/form/textarea/textarea.d.mts +1 -1
- package/dist/components/form/textarea/textarea.mjs +1 -1
- package/dist/components/icons/index.d.mts +3 -2
- package/dist/components/icons/index.mjs +3 -2
- package/dist/components/icons/logo.mjs +3 -3
- package/dist/components/icons/lucide.d.mts +2 -1
- package/dist/components/icons/lucide.mjs +6 -2
- package/dist/components/icons/qiita.mjs +4 -4
- package/dist/components/icons/twitter.mjs +1 -1
- package/dist/components/icons/vertical-writing.d.mts +7 -0
- package/dist/components/icons/vertical-writing.mjs +25 -0
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.mjs +3 -2
- package/dist/components/layout/separator/separator.d.mts +1 -1
- package/dist/components/layout/separator/separator.mjs +2 -5
- package/dist/components/navigation/anchor/anchor.d.mts +1 -1
- package/dist/components/navigation/anchor/anchor.mjs +1 -2
- package/dist/components/navigation/breadcrumb/breadcrumb.mjs +1 -1
- package/dist/components/navigation/pagination/pagination.mjs +12 -6
- package/dist/components/navigation/tabs/tabs.mjs +25 -25
- package/dist/components/overlays/dialog/dialog.mjs +3 -7
- package/dist/components/overlays/drawer/drawer.mjs +1 -1
- package/dist/components/overlays/dropdown-menu/dropdown-menu.mjs +1 -1
- package/dist/components/overlays/dropdown-menu/hooks.d.mts +2 -3
- package/dist/components/overlays/dropdown-menu/hooks.mjs +4 -9
- package/dist/components/overlays/list-box/hooks.d.mts +0 -1
- package/dist/components/overlays/list-box/hooks.mjs +3 -8
- package/dist/components/overlays/list-box/list-box.mjs +1 -1
- package/dist/components/overlays/modal/modal.mjs +9 -5
- package/dist/components/overlays/popover/hooks.d.mts +1 -3
- package/dist/components/overlays/popover/hooks.mjs +3 -8
- package/dist/components/overlays/popover/popover.mjs +8 -2
- package/dist/components/overlays/tooltip/tooltip.mjs +19 -6
- package/dist/helpers/chain.d.mts +5 -0
- package/dist/helpers/chain.mjs +29 -0
- package/dist/helpers/create-safe-context.d.mts +7 -0
- package/dist/helpers/create-safe-context.mjs +13 -0
- package/dist/helpers/index.d.mts +5 -8
- package/dist/helpers/index.mjs +5 -8
- package/dist/helpers/merge-props.d.mts +6 -0
- package/dist/helpers/merge-props.mjs +56 -0
- package/dist/hooks/click-away/index.mjs +1 -1
- package/dist/hooks/index.d.mts +2 -1
- package/dist/hooks/index.mjs +2 -1
- package/dist/hooks/writing-mode/index.d.mts +7 -0
- package/dist/hooks/writing-mode/index.mjs +22 -0
- package/dist/index.d.mts +8 -9
- package/dist/index.mjs +8 -9
- package/dist/internal/clamp.d.mts +4 -0
- package/dist/internal/clamp.mjs +15 -0
- package/dist/{helpers/number → internal}/to-precision.d.mts +1 -1
- package/dist/{helpers/number → internal}/to-precision.mjs +1 -1
- package/dist/styles/index.css +37 -0
- package/dist/styles/tokens.d.mts +12 -1
- package/dist/styles/tokens.mjs +25 -1
- package/docs/references/typography.md +29 -0
- package/package.json +2 -2
- package/dist/helpers/is-internal-route.d.mts +0 -4
- package/dist/helpers/is-internal-route.mjs +0 -12
- package/dist/helpers/number/between.d.mts +0 -4
- package/dist/helpers/number/between.mjs +0 -15
- package/dist/helpers/number/commalize.d.mts +0 -4
- package/dist/helpers/number/commalize.mjs +0 -20
- package/dist/helpers/number/index.d.mts +0 -5
- package/dist/helpers/number/index.mjs +0 -5
- package/dist/helpers/uuid-v4.d.mts +0 -4
- package/dist/helpers/uuid-v4.mjs +0 -28
|
@@ -8,14 +8,14 @@ const Qiita = ({ className }) => /* @__PURE__ */ jsxs("svg", {
|
|
|
8
8
|
viewBox: "0 0 300 300",
|
|
9
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
10
10
|
children: [/* @__PURE__ */ jsx("path", {
|
|
11
|
-
d: "\nM170.
|
|
11
|
+
d: "\nM170.00,301.00 \n C155.98,301.00 141.96,301.00 127.35,300.63 \n C126.24,299.87 125.76,299.21 125.20,299.13 \n C106.99,296.55 90.22,289.99 74.41,280.79 \n C57.08,270.70 42.21,257.64 30.40,241.57 \n C17.26,223.68 7.53,204.01 3.83,181.76 \n C3.44,179.42 1.97,177.25 1.00,175.00 \n C1.00,159.31 1.00,143.62 1.37,127.35 \n C2.16,125.91 2.75,125.10 2.96,124.21 \n C4.27,118.70 5.15,113.07 6.79,107.67 \n C14.92,80.92 29.17,58.11 50.06,39.28 \n C66.69,24.30 85.52,13.55 106.81,7.03 \n C114.44,4.70 122.26,2.99 130.00,1.00 \n C144.35,1.00 158.71,1.00 173.67,1.36 \n C175.17,2.13 176.02,2.66 176.95,2.92 \n C186.59,5.62 196.44,7.73 205.85,11.06 \n C232.83,20.58 254.47,37.78 271.49,60.35 \n C284.87,78.08 294.49,97.92 298.16,120.22 \n C298.55,122.58 300.03,124.75 301.00,127.00 \n C301.00,127.00 301.00,127.50 300.67,127.85 \n C300.56,129.13 300.78,130.07 301.00,131.00 \n C301.00,145.35 301.00,159.71 300.63,174.65 \n C299.17,179.59 298.12,183.95 296.99,188.29 \n C293.93,200.06 289.71,211.37 283.83,222.00 \n C274.89,218.56 269.44,218.19 260.01,219.87 \n C258.35,220.17 256.09,220.08 254.83,219.16 \n C245.13,212.12 238.85,205.04 243.48,192.58 \n C246.15,185.39 247.37,177.40 247.77,169.69 \n C248.16,162.24 246.97,154.64 245.95,147.17 \n C243.29,127.59 235.48,110.16 223.22,94.68 \n C221.02,91.91 217.97,89.20 217.25,86.02 \n C216.02,80.64 216.26,74.90 216.03,69.31 \n C215.88,65.65 216.19,61.96 215.96,58.31 \n C215.47,50.74 210.89,48.36 204.49,52.19 \n C199.48,55.18 194.13,57.74 189.57,61.31 \n C185.80,64.26 182.76,63.56 178.91,62.05 \n C163.35,55.96 147.25,55.54 131.04,58.51 \n C117.56,60.98 105.90,67.68 94.50,74.96 \n C92.48,76.25 89.34,76.72 86.93,76.31 \n C80.88,75.27 74.98,73.40 68.98,72.08 \n C63.87,70.96 60.62,74.59 61.90,79.73 \n C62.92,83.81 63.68,87.98 65.00,91.96 \n C68.00,100.99 67.47,108.98 62.43,117.71 \n C56.07,128.72 53.74,141.57 53.23,154.22 \n C52.79,165.18 53.42,176.38 55.23,187.20 \n C57.65,201.60 63.63,214.93 73.51,225.90 \n C90.29,244.49 112.10,252.72 136.56,253.81 \n C147.36,254.29 158.27,252.89 169.10,251.95 \n C181.31,250.87 193.16,247.93 203.90,241.91 \n C211.07,237.88 217.72,232.91 223.48,229.10 \n C228.86,234.44 233.77,240.46 239.81,244.96 \n C245.72,249.37 252.79,252.22 259.77,255.97 \n C254.96,260.09 249.64,264.89 244.07,269.38 \n C228.58,281.87 211.13,290.65 191.99,295.95 \n C184.75,297.95 177.34,299.33 170.00,301.00 \nz",
|
|
12
12
|
fill: "#55C500",
|
|
13
|
-
opacity: "1.
|
|
13
|
+
opacity: "1.00",
|
|
14
14
|
stroke: "none"
|
|
15
15
|
}), /* @__PURE__ */ jsx("path", {
|
|
16
|
-
d: "\nM201.
|
|
16
|
+
d: "\nM201.23,166.28 \n C189.03,176.10 175.09,180.47 160.14,181.96 \n C150.82,182.88 141.43,184.14 132.12,183.81 \n C118.49,183.33 105.09,180.78 94.96,170.37 \n C86.98,162.16 83.84,151.87 83.87,140.38 \n C79.76,142.15 75.81,143.84 71.86,145.53 \n C71.43,145.03 70.99,144.53 70.56,144.04 \n C71.61,142.71 72.39,140.92 73.75,140.17 \n C76.27,138.78 79.26,138.24 81.79,136.87 \n C83.04,136.19 83.71,134.45 85.18,132.44 \n C79.51,132.44 75.18,132.44 70.38,132.44 \n C70.30,131.77 70.16,130.61 70.02,129.51 \n C75.18,127.89 81.27,130.22 85.99,124.27 \n C81.13,123.77 77.32,123.37 73.50,123.00 \n C70.70,122.73 68.22,122.20 69.41,117.91 \n C73.09,118.51 76.74,119.06 80.36,119.73 \n C83.67,120.33 85.66,120.26 87.22,116.06 \n C96.19,91.86 113.31,77.04 139.13,73.01 \n C162.04,69.44 181.37,76.33 196.90,93.51 \n C199.93,96.87 202.45,100.74 204.79,104.63 \n C206.07,106.76 206.94,107.32 209.40,106.38 \n C212.69,105.12 216.24,104.44 219.73,103.80 \n C220.98,103.58 222.38,104.19 223.71,104.42 \n C223.71,104.86 223.71,105.29 223.72,105.72 \n C218.54,107.58 213.36,109.43 208.00,111.35 \n C212.07,119.52 219.17,110.88 224.17,115.11 \n C221.41,120.75 214.59,115.81 211.18,119.90 \n C211.36,123.79 214.46,123.98 217.68,124.37 \n C220.48,124.71 223.23,125.53 226.13,126.17 \n C224.53,129.57 224.53,129.57 212.76,127.41 \n C214.08,141.79 212.91,155.47 201.23,166.28 \nz",
|
|
17
17
|
fill: "#55C500",
|
|
18
|
-
opacity: "1.
|
|
18
|
+
opacity: "1.00",
|
|
19
19
|
stroke: "none"
|
|
20
20
|
})]
|
|
21
21
|
});
|
|
@@ -8,7 +8,7 @@ const Twitter = ({ className }) => /* @__PURE__ */ jsx("svg", {
|
|
|
8
8
|
xmlns: "http://www.w3.org/2000/svg",
|
|
9
9
|
children: /* @__PURE__ */ jsx("path", {
|
|
10
10
|
className: "fill-fg-base",
|
|
11
|
-
d: "M714.
|
|
11
|
+
d: "M714.16 519.28L1160.89 0H1055.03L667.14 450.89L357.33 0H0L468.49 681.82L0 1226.37H105.87L515.49 750.22L842.67 1226.37H1200L714.14 519.28H714.16ZM569.16 687.83L521.70 619.93L144.01 79.69H306.62L611.41 515.68L658.88 583.58L1055.08 1150.3H892.48L569.16 687.85V687.83Z"
|
|
12
12
|
})
|
|
13
13
|
});
|
|
14
14
|
const TwitterIcon = ({ size = "md" }) => /* @__PURE__ */ jsx(BaseIcon, {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseIcon } from "./base.mjs";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/icons/vertical-writing.tsx
|
|
4
|
+
const VerticalWriting = ({ className }) => /* @__PURE__ */ jsxs("svg", {
|
|
5
|
+
className,
|
|
6
|
+
fill: "none",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
strokeLinecap: "round",
|
|
9
|
+
strokeLinejoin: "round",
|
|
10
|
+
strokeWidth: "2",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7v14" }),
|
|
15
|
+
/* @__PURE__ */ jsx("path", { d: "M17 8v4" }),
|
|
16
|
+
/* @__PURE__ */ jsx("path", { d: "M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z" }),
|
|
17
|
+
/* @__PURE__ */ jsx("path", { d: "M7 8v4" })
|
|
18
|
+
]
|
|
19
|
+
});
|
|
20
|
+
const VerticalWritingIcon = ({ size = "md" }) => /* @__PURE__ */ jsx(BaseIcon, {
|
|
21
|
+
renderItem: (props) => /* @__PURE__ */ jsx(VerticalWriting, { ...props }),
|
|
22
|
+
size
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { VerticalWritingIcon };
|
|
@@ -35,9 +35,10 @@ import { Textarea } from "./form/textarea/textarea.mjs";
|
|
|
35
35
|
import { ArteOdyssey } from "./icons/arte-odyssey.mjs";
|
|
36
36
|
import { GitHubIcon } from "./icons/github-mark.mjs";
|
|
37
37
|
import { Logo, LogoIcon } from "./icons/logo.mjs";
|
|
38
|
-
import { AIIcon, AccessibilityIcon, AlertIcon, AtomIcon, BadIcon, BlogIcon, BoringIcon, CheckIcon, ChevronIcon, CloseIcon, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, DifficultIcon, EasyIcon, ExternalLinkIcon, FormIcon, GoodIcon, HistoryIcon, InformativeIcon, InterestingIcon, LightModeIcon, LinkIcon, ListIcon, LocationIcon, MailIcon, MinusIcon, MixedColorIcon, NavigationMenuIcon, NewsIcon, PaletteIcon, PlusIcon, PrepareIcon, PublishDateIcon, RSSIcon, SendIcon, ShallowIcon, ShieldCheckIcon, SlideIcon, SparklesIcon, SubscribeIcon, TableIcon, TagIcon, UpdateDateIcon, ViewIcon, ViewOffIcon } from "./icons/lucide.mjs";
|
|
38
|
+
import { AIIcon, AccessibilityIcon, AlertIcon, AtomIcon, BadIcon, BlogIcon, BoringIcon, CheckIcon, ChevronIcon, CloseIcon, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, DifficultIcon, EasyIcon, ExternalLinkIcon, FormIcon, GoodIcon, HistoryIcon, HorizontalWritingIcon, InformativeIcon, InterestingIcon, LightModeIcon, LinkIcon, ListIcon, LocationIcon, MailIcon, MinusIcon, MixedColorIcon, NavigationMenuIcon, NewsIcon, PaletteIcon, PlusIcon, PrepareIcon, PublishDateIcon, RSSIcon, SendIcon, ShallowIcon, ShieldCheckIcon, SlideIcon, SparklesIcon, SubscribeIcon, TableIcon, TagIcon, UpdateDateIcon, ViewIcon, ViewOffIcon } from "./icons/lucide.mjs";
|
|
39
39
|
import { QiitaIcon } from "./icons/qiita.mjs";
|
|
40
40
|
import { TwitterIcon } from "./icons/twitter.mjs";
|
|
41
|
+
import { VerticalWritingIcon } from "./icons/vertical-writing.mjs";
|
|
41
42
|
import { ScrollLinked } from "./layout/scroll-linked/scroll-linked.mjs";
|
|
42
43
|
import { Separator } from "./layout/separator/separator.mjs";
|
|
43
44
|
import { Anchor } from "./navigation/anchor/anchor.mjs";
|
|
@@ -53,4 +54,4 @@ import { useOpenContext } from "./overlays/popover/hooks.mjs";
|
|
|
53
54
|
import { Popover } from "./overlays/popover/popover.mjs";
|
|
54
55
|
import { ArteOdysseyProvider } from "./providers/arte-odyssey-provider.mjs";
|
|
55
56
|
import { PortalRootProvider, usePortalRoot } from "./providers/portal-root.mjs";
|
|
56
|
-
export { AIIcon, AccessibilityIcon, Accordion, Alert, AlertIcon, Anchor, ArteOdyssey, ArteOdysseyProvider, AtomIcon, Autocomplete, Avatar, BadIcon, Badge, BaselineStatus, BlogIcon, BoringIcon, Breadcrumb, Button, Card, CheckIcon, Checkbox, CheckboxCard, CheckboxGroup, ChevronIcon, CloseIcon, Code, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, Dialog, DifficultIcon, Drawer, DropdownMenu, EasyIcon, ExternalLinkIcon, FileField, Form, FormControl, FormIcon, GitHubIcon, GoodIcon, Heading, HistoryIcon, IconButton, InformativeIcon, InteractiveCard, InterestingIcon, LightModeIcon, LinkIcon, ListBox, ListIcon, LocationIcon, Logo, LogoIcon, MailIcon, MinusIcon, MixedColorIcon, Modal, NavigationMenuIcon, NewsIcon, NumberField, Pagination, PaletteIcon, PasswordInput, PlusIcon, Popover, PortalRootProvider, PrepareIcon, Progress, PublishDateIcon, QiitaIcon, RSSIcon, Radio, RadioCard, ScrollLinked, Select, SendIcon, Separator, ShallowIcon, ShieldCheckIcon, Skeleton, SlideIcon, Slider, SparklesIcon, Spinner, SubscribeIcon, Switch, Table, TableIcon, Tabs, TagIcon, TextField, Textarea, ToastProvider, Tooltip, TwitterIcon, UpdateDateIcon, ViewIcon, ViewOffIcon, useOpenContext, usePortalRoot, useToast };
|
|
57
|
+
export { AIIcon, AccessibilityIcon, Accordion, Alert, AlertIcon, Anchor, ArteOdyssey, ArteOdysseyProvider, AtomIcon, Autocomplete, Avatar, BadIcon, Badge, BaselineStatus, BlogIcon, BoringIcon, Breadcrumb, Button, Card, CheckIcon, Checkbox, CheckboxCard, CheckboxGroup, ChevronIcon, CloseIcon, Code, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, Dialog, DifficultIcon, Drawer, DropdownMenu, EasyIcon, ExternalLinkIcon, FileField, Form, FormControl, FormIcon, GitHubIcon, GoodIcon, Heading, HistoryIcon, HorizontalWritingIcon, IconButton, InformativeIcon, InteractiveCard, InterestingIcon, LightModeIcon, LinkIcon, ListBox, ListIcon, LocationIcon, Logo, LogoIcon, MailIcon, MinusIcon, MixedColorIcon, Modal, NavigationMenuIcon, NewsIcon, NumberField, Pagination, PaletteIcon, PasswordInput, PlusIcon, Popover, PortalRootProvider, PrepareIcon, Progress, PublishDateIcon, QiitaIcon, RSSIcon, Radio, RadioCard, ScrollLinked, Select, SendIcon, Separator, ShallowIcon, ShieldCheckIcon, Skeleton, SlideIcon, Slider, SparklesIcon, Spinner, SubscribeIcon, Switch, Table, TableIcon, Tabs, TagIcon, TextField, Textarea, ToastProvider, Tooltip, TwitterIcon, UpdateDateIcon, VerticalWritingIcon, ViewIcon, ViewOffIcon, useOpenContext, usePortalRoot, useToast };
|
|
@@ -4,9 +4,10 @@ import { useToast } from "./feedback/toast/context.mjs";
|
|
|
4
4
|
import { ArteOdyssey } from "./icons/arte-odyssey.mjs";
|
|
5
5
|
import { GitHubIcon } from "./icons/github-mark.mjs";
|
|
6
6
|
import { Logo, LogoIcon } from "./icons/logo.mjs";
|
|
7
|
-
import { AIIcon, AccessibilityIcon, AlertIcon, AtomIcon, BadIcon, BlogIcon, BoringIcon, CheckIcon, ChevronIcon, CloseIcon, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, DifficultIcon, EasyIcon, ExternalLinkIcon, FormIcon, GoodIcon, HistoryIcon, InformativeIcon, InterestingIcon, LightModeIcon, LinkIcon, ListIcon, LocationIcon, MailIcon, MinusIcon, MixedColorIcon, NavigationMenuIcon, NewsIcon, PaletteIcon, PlusIcon, PrepareIcon, PublishDateIcon, RSSIcon, SendIcon, ShallowIcon, ShieldCheckIcon, SlideIcon, SparklesIcon, SubscribeIcon, TableIcon, TagIcon, UpdateDateIcon, ViewIcon, ViewOffIcon } from "./icons/lucide.mjs";
|
|
7
|
+
import { AIIcon, AccessibilityIcon, AlertIcon, AtomIcon, BadIcon, BlogIcon, BoringIcon, CheckIcon, ChevronIcon, CloseIcon, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, DifficultIcon, EasyIcon, ExternalLinkIcon, FormIcon, GoodIcon, HistoryIcon, HorizontalWritingIcon, InformativeIcon, InterestingIcon, LightModeIcon, LinkIcon, ListIcon, LocationIcon, MailIcon, MinusIcon, MixedColorIcon, NavigationMenuIcon, NewsIcon, PaletteIcon, PlusIcon, PrepareIcon, PublishDateIcon, RSSIcon, SendIcon, ShallowIcon, ShieldCheckIcon, SlideIcon, SparklesIcon, SubscribeIcon, TableIcon, TagIcon, UpdateDateIcon, ViewIcon, ViewOffIcon } from "./icons/lucide.mjs";
|
|
8
8
|
import { QiitaIcon } from "./icons/qiita.mjs";
|
|
9
9
|
import { TwitterIcon } from "./icons/twitter.mjs";
|
|
10
|
+
import { VerticalWritingIcon } from "./icons/vertical-writing.mjs";
|
|
10
11
|
import { Alert } from "./feedback/alert/alert.mjs";
|
|
11
12
|
import { ToastProvider } from "./feedback/toast/provider.mjs";
|
|
12
13
|
import { ArteOdysseyProvider } from "./providers/arte-odyssey-provider.mjs";
|
|
@@ -53,4 +54,4 @@ import { Modal } from "./overlays/modal/modal.mjs";
|
|
|
53
54
|
import { Drawer } from "./overlays/drawer/drawer.mjs";
|
|
54
55
|
import { DropdownMenu } from "./overlays/dropdown-menu/dropdown-menu.mjs";
|
|
55
56
|
import { ListBox } from "./overlays/list-box/list-box.mjs";
|
|
56
|
-
export { AIIcon, AccessibilityIcon, Accordion, Alert, AlertIcon, Anchor, ArteOdyssey, ArteOdysseyProvider, AtomIcon, Autocomplete, Avatar, BadIcon, Badge, BaselineStatus, BlogIcon, BoringIcon, Breadcrumb, Button, Card, CheckIcon, Checkbox, CheckboxCard, CheckboxGroup, ChevronIcon, CloseIcon, Code, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, Dialog, DifficultIcon, Drawer, DropdownMenu, EasyIcon, ExternalLinkIcon, FileField, Form, FormControl, FormIcon, GitHubIcon, GoodIcon, Heading, HistoryIcon, IconButton, InformativeIcon, InteractiveCard, InterestingIcon, LightModeIcon, LinkIcon, ListBox, ListIcon, LocationIcon, Logo, LogoIcon, MailIcon, MinusIcon, MixedColorIcon, Modal, NavigationMenuIcon, NewsIcon, NumberField, Pagination, PaletteIcon, PasswordInput, PlusIcon, Popover, PortalRootProvider, PrepareIcon, Progress, PublishDateIcon, QiitaIcon, RSSIcon, Radio, RadioCard, ScrollLinked, Select, SendIcon, Separator, ShallowIcon, ShieldCheckIcon, Skeleton, SlideIcon, Slider, SparklesIcon, Spinner, SubscribeIcon, Switch, Table, TableIcon, Tabs, TagIcon, TextField, Textarea, ToastProvider, Tooltip, TwitterIcon, UpdateDateIcon, ViewIcon, ViewOffIcon, useOpenContext, usePortalRoot, useToast };
|
|
57
|
+
export { AIIcon, AccessibilityIcon, Accordion, Alert, AlertIcon, Anchor, ArteOdyssey, ArteOdysseyProvider, AtomIcon, Autocomplete, Avatar, BadIcon, Badge, BaselineStatus, BlogIcon, BoringIcon, Breadcrumb, Button, Card, CheckIcon, Checkbox, CheckboxCard, CheckboxGroup, ChevronIcon, CloseIcon, Code, ColorContrastIcon, ColorInfoIcon, CopyIcon, DarkModeIcon, Dialog, DifficultIcon, Drawer, DropdownMenu, EasyIcon, ExternalLinkIcon, FileField, Form, FormControl, FormIcon, GitHubIcon, GoodIcon, Heading, HistoryIcon, HorizontalWritingIcon, IconButton, InformativeIcon, InteractiveCard, InterestingIcon, LightModeIcon, LinkIcon, ListBox, ListIcon, LocationIcon, Logo, LogoIcon, MailIcon, MinusIcon, MixedColorIcon, Modal, NavigationMenuIcon, NewsIcon, NumberField, Pagination, PaletteIcon, PasswordInput, PlusIcon, Popover, PortalRootProvider, PrepareIcon, Progress, PublishDateIcon, QiitaIcon, RSSIcon, Radio, RadioCard, ScrollLinked, Select, SendIcon, Separator, ShallowIcon, ShieldCheckIcon, Skeleton, SlideIcon, Slider, SparklesIcon, Spinner, SubscribeIcon, Switch, Table, TableIcon, Tabs, TagIcon, TextField, Textarea, ToastProvider, Tooltip, TwitterIcon, UpdateDateIcon, VerticalWritingIcon, ViewIcon, ViewOffIcon, useOpenContext, usePortalRoot, useToast };
|
|
@@ -4,7 +4,7 @@ import { FC, HTMLAttributes } from "react";
|
|
|
4
4
|
type Props = {
|
|
5
5
|
orientation?: 'horizontal' | 'vertical';
|
|
6
6
|
color?: 'base' | 'mute' | 'subtle';
|
|
7
|
-
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'role' | 'aria-orientation'>;
|
|
7
|
+
} & Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'role' | 'aria-orientation' | 'className' | 'style'>;
|
|
8
8
|
declare const Separator: FC<Props>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { Separator };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { cn } from "../../../helpers/cn.mjs";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/layout/separator/separator.tsx
|
|
4
|
-
const Separator = ({ orientation = "horizontal", color = "base",
|
|
4
|
+
const Separator = ({ orientation = "horizontal", color = "base", ...rest }) => {
|
|
5
5
|
const isVertical = orientation === "vertical";
|
|
6
6
|
return /* @__PURE__ */ jsx("span", {
|
|
7
7
|
...rest,
|
|
8
8
|
"aria-orientation": orientation,
|
|
9
|
-
className: cn("block",
|
|
10
|
-
"h-full w-px": isVertical,
|
|
11
|
-
"h-px w-full": !isVertical
|
|
12
|
-
}, color === "base" && "bg-border-base", color === "mute" && "bg-border-mute", color === "subtle" && "bg-border-subtle", className),
|
|
9
|
+
className: cn("block", isVertical ? "block-full inline-px" : "block-px inline-full", color === "base" && "bg-border-base", color === "mute" && "bg-border-mute", color === "subtle" && "bg-border-subtle"),
|
|
13
10
|
role: "separator"
|
|
14
11
|
});
|
|
15
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AnchorHTMLAttributes, ReactNode } from "react";
|
|
2
2
|
|
|
3
3
|
//#region src/components/navigation/anchor/anchor.d.ts
|
|
4
|
-
type RestProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children' | 'target' | 'rel' | 'className'>;
|
|
4
|
+
type RestProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href' | 'children' | 'target' | 'rel' | 'className' | 'style'>;
|
|
5
5
|
type Props<T extends string> = {
|
|
6
6
|
href: T;
|
|
7
7
|
children: ReactNode;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ExternalLinkIcon } from "../../icons/lucide.mjs";
|
|
2
|
-
import { isInternalRoute } from "../../../helpers/is-internal-route.mjs";
|
|
3
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
3
|
//#region src/components/navigation/anchor/anchor.tsx
|
|
5
4
|
const Anchor = ({ href, children, openInNewTab = false, renderAnchor = ({ children: anchorChildren, ...rest }) => /* @__PURE__ */ jsx("a", {
|
|
6
5
|
...rest,
|
|
7
6
|
children: anchorChildren
|
|
8
7
|
}), ...rest }) => {
|
|
9
|
-
const type =
|
|
8
|
+
const type = !href.startsWith("http") && !openInNewTab ? "internal" : "external";
|
|
10
9
|
const baseClassName = "text-fg-info underline transition-colors hover:text-fg-info/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-info focus-visible:rounded-sm";
|
|
11
10
|
const props = type === "internal" ? {
|
|
12
11
|
className: baseClassName,
|
|
@@ -14,7 +14,7 @@ const Item = ({ children }) => /* @__PURE__ */ jsx("li", {
|
|
|
14
14
|
children
|
|
15
15
|
});
|
|
16
16
|
const Separator = () => /* @__PURE__ */ jsx("li", {
|
|
17
|
-
className: "text-fg-mute",
|
|
17
|
+
className: "text-fg-mute vertical:rotate-90",
|
|
18
18
|
children: /* @__PURE__ */ jsx(ChevronIcon, {
|
|
19
19
|
direction: "right",
|
|
20
20
|
size: "sm"
|
|
@@ -18,9 +18,12 @@ const Pagination = ({ totalPages, currentPage, onPageChange, disabled = false, p
|
|
|
18
18
|
onPageChange(safeCurrent - 1);
|
|
19
19
|
},
|
|
20
20
|
size: "sm",
|
|
21
|
-
startIcon: /* @__PURE__ */ jsx(
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
startIcon: /* @__PURE__ */ jsx("span", {
|
|
22
|
+
className: "vertical:rotate-90 inline-flex",
|
|
23
|
+
children: /* @__PURE__ */ jsx(ChevronIcon, {
|
|
24
|
+
direction: "left",
|
|
25
|
+
size: "sm"
|
|
26
|
+
})
|
|
24
27
|
}),
|
|
25
28
|
variant: "skeleton",
|
|
26
29
|
children: prevLabel
|
|
@@ -44,9 +47,12 @@ const Pagination = ({ totalPages, currentPage, onPageChange, disabled = false, p
|
|
|
44
47
|
/* @__PURE__ */ jsx(Button, {
|
|
45
48
|
color: "gray",
|
|
46
49
|
disabled: disabled || safeCurrent >= safeTotal,
|
|
47
|
-
endIcon: /* @__PURE__ */ jsx(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
endIcon: /* @__PURE__ */ jsx("span", {
|
|
51
|
+
className: "vertical:rotate-90 inline-flex",
|
|
52
|
+
children: /* @__PURE__ */ jsx(ChevronIcon, {
|
|
53
|
+
direction: "right",
|
|
54
|
+
size: "sm"
|
|
55
|
+
})
|
|
50
56
|
}),
|
|
51
57
|
onClick: () => {
|
|
52
58
|
onPageChange(safeCurrent + 1);
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../helpers/cn.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { useWritingMode } from "../../../hooks/writing-mode/index.mjs";
|
|
4
|
+
import { createSafeContext } from "../../../helpers/create-safe-context.mjs";
|
|
5
|
+
import { useEffect, useId, useMemo, useRef, useState } from "react";
|
|
4
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
7
|
import * as motion from "motion/react-client";
|
|
6
8
|
//#region src/components/navigation/tabs/tabs.tsx
|
|
7
|
-
const TabsProvider =
|
|
8
|
-
const useTabsState = () => {
|
|
9
|
-
const context = use(TabsProvider);
|
|
10
|
-
if (!context) throw new Error("useTabsState must be used within a TabsProvider");
|
|
11
|
-
return context;
|
|
12
|
-
};
|
|
9
|
+
const [TabsProvider, useTabsState] = createSafeContext("useTabsState must be used within a TabsProvider");
|
|
13
10
|
const Root = ({ defaultSelectedId = null, ids, children }) => {
|
|
14
11
|
const defaultIndex = defaultSelectedId !== null && defaultSelectedId !== "" ? ids.indexOf(defaultSelectedId) : 0;
|
|
15
12
|
const [selectedId, setSelectedId] = useState(defaultSelectedId ?? ids[defaultIndex] ?? ids[0]);
|
|
@@ -31,21 +28,22 @@ const Root = ({ defaultSelectedId = null, ids, children }) => {
|
|
|
31
28
|
})
|
|
32
29
|
});
|
|
33
30
|
};
|
|
34
|
-
const TabsListProvider =
|
|
35
|
-
const useTabsListState = () => {
|
|
36
|
-
const context = use(TabsListProvider);
|
|
37
|
-
if (!context) throw new Error("useTabListState must be used within a TabListProvider");
|
|
38
|
-
return context;
|
|
39
|
-
};
|
|
31
|
+
const [TabsListProvider, useTabsListState] = createSafeContext("useTabListState must be used within a TabListProvider");
|
|
40
32
|
const List = ({ label, children }) => {
|
|
41
33
|
const { rootId } = useTabsState();
|
|
42
34
|
const setFocusRef = useRef(false);
|
|
43
|
-
const
|
|
35
|
+
const listRef = useRef(null);
|
|
36
|
+
const writingMode = useWritingMode(listRef);
|
|
37
|
+
const listContextValue = useMemo(() => ({
|
|
38
|
+
setFocusRef,
|
|
39
|
+
writingMode
|
|
40
|
+
}), [writingMode]);
|
|
44
41
|
return /* @__PURE__ */ jsx("div", {
|
|
45
42
|
"aria-label": label,
|
|
46
|
-
"aria-orientation": "horizontal",
|
|
47
|
-
className: "border-border-base flex overflow-x-auto overflow-y-hidden border-b p-0.5 wrap-normal",
|
|
43
|
+
"aria-orientation": writingMode === "vertical" ? "vertical" : "horizontal",
|
|
44
|
+
className: "border-border-base vertical:border-b-0 vertical:border-l vertical:overflow-x-hidden vertical:overflow-y-auto flex overflow-x-auto overflow-y-hidden border-b p-0.5 wrap-normal",
|
|
48
45
|
id: `${rootId}-tablist`,
|
|
46
|
+
ref: listRef,
|
|
49
47
|
role: "tablist",
|
|
50
48
|
children: /* @__PURE__ */ jsx(TabsListProvider, {
|
|
51
49
|
value: listContextValue,
|
|
@@ -55,7 +53,7 @@ const List = ({ label, children }) => {
|
|
|
55
53
|
};
|
|
56
54
|
const Tab = ({ id, children }) => {
|
|
57
55
|
const { rootId, ids, selectedId, setSelectedId } = useTabsState();
|
|
58
|
-
const { setFocusRef } = useTabsListState();
|
|
56
|
+
const { setFocusRef, writingMode } = useTabsListState();
|
|
59
57
|
const ref = useRef(null);
|
|
60
58
|
const activeIndex = ids.indexOf(selectedId);
|
|
61
59
|
const index = ids.indexOf(id);
|
|
@@ -69,6 +67,10 @@ const Tab = ({ id, children }) => {
|
|
|
69
67
|
index,
|
|
70
68
|
setFocusRef
|
|
71
69
|
]);
|
|
70
|
+
const moveTo = (direction) => {
|
|
71
|
+
setSelectedId(ids[direction === 1 ? index === ids.length - 1 ? 0 : index + 1 : index === 0 ? ids.length - 1 : index - 1] ?? ids[0]);
|
|
72
|
+
setFocusRef.current = true;
|
|
73
|
+
};
|
|
72
74
|
return /* @__PURE__ */ jsxs("div", {
|
|
73
75
|
"aria-controls": selectedId === id ? `${rootId}-panel-${id}` : void 0,
|
|
74
76
|
"aria-selected": selectedId === id,
|
|
@@ -78,21 +80,19 @@ const Tab = ({ id, children }) => {
|
|
|
78
80
|
setSelectedId(id);
|
|
79
81
|
},
|
|
80
82
|
onKeyDown: (e) => {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
const prevKey = writingMode === "vertical" ? "ArrowUp" : "ArrowLeft";
|
|
84
|
+
const nextKey = writingMode === "vertical" ? "ArrowDown" : "ArrowRight";
|
|
85
|
+
if (e.key === prevKey) {
|
|
86
|
+
moveTo(-1);
|
|
84
87
|
return;
|
|
85
88
|
}
|
|
86
|
-
if (e.key ===
|
|
87
|
-
setSelectedId(ids[index === ids.length - 1 ? 0 : index + 1] ?? ids[0]);
|
|
88
|
-
setFocusRef.current = true;
|
|
89
|
-
}
|
|
89
|
+
if (e.key === nextKey) moveTo(1);
|
|
90
90
|
},
|
|
91
91
|
ref,
|
|
92
92
|
role: "tab",
|
|
93
93
|
tabIndex: activeIndex === index ? 0 : -1,
|
|
94
94
|
children: [selectedId === id && /* @__PURE__ */ jsx(motion.div, {
|
|
95
|
-
className: "bg-primary-border absolute
|
|
95
|
+
className: "bg-primary-border absolute start-0 end-0 -inset-be-0.5 block-1",
|
|
96
96
|
layoutId: `${rootId}-underline`
|
|
97
97
|
}), children]
|
|
98
98
|
});
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createSafeContext } from "../../../helpers/create-safe-context.mjs";
|
|
2
3
|
import { CloseIcon } from "../../icons/lucide.mjs";
|
|
3
4
|
import { IconButton } from "../../buttons/icon-button/icon-button.mjs";
|
|
4
5
|
import { Heading } from "../../data-display/heading/heading.mjs";
|
|
5
|
-
import {
|
|
6
|
+
import { useId, useMemo } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region src/components/overlays/dialog/dialog.tsx
|
|
8
|
-
const DialogContext =
|
|
9
|
-
const useDialogContext = () => {
|
|
10
|
-
const context = use(DialogContext);
|
|
11
|
-
if (context === null) throw new Error("useDialogContext must be used within a DialogProvider");
|
|
12
|
-
return context;
|
|
13
|
-
};
|
|
9
|
+
const [DialogContext, useDialogContext] = createSafeContext("useDialogContext must be used within a DialogProvider");
|
|
14
10
|
const Root = ({ ref, id, children, tabIndex, role = "dialog" }) => {
|
|
15
11
|
const fallbackId = useId();
|
|
16
12
|
const rootId = id ?? fallbackId;
|
|
@@ -16,7 +16,7 @@ const Drawer = ({ title, isOpen, onClose, side = "right", children }) => {
|
|
|
16
16
|
children: /* @__PURE__ */ jsxs("section", {
|
|
17
17
|
"aria-describedby": `${rootId}-content`,
|
|
18
18
|
"aria-labelledby": `${rootId}-header`,
|
|
19
|
-
className: "flex h-full flex-col",
|
|
19
|
+
className: "vertical:flex-row flex h-full flex-col",
|
|
20
20
|
id: rootId,
|
|
21
21
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
22
22
|
className: "flex shrink-0 items-center justify-center p-4 pb-2",
|
|
@@ -42,7 +42,7 @@ const Content = ({ children }) => {
|
|
|
42
42
|
children: /* @__PURE__ */ jsx(Popover.Content, { renderItem: (props) => /* @__PURE__ */ jsx("div", {
|
|
43
43
|
...props,
|
|
44
44
|
...contentProps,
|
|
45
|
-
className: "bg-bg-raised flex min-w-40 flex-col rounded-lg py-2 shadow-md",
|
|
45
|
+
className: "bg-bg-raised vertical:min-w-0 vertical:min-h-40 flex min-w-40 flex-col rounded-lg py-2 shadow-md",
|
|
46
46
|
children
|
|
47
47
|
}) })
|
|
48
48
|
});
|
|
@@ -9,8 +9,7 @@ type MenuContext = {
|
|
|
9
9
|
getContentProps: (userProps?: HTMLProps<HTMLElement>) => HTMLAttributes<HTMLElement>;
|
|
10
10
|
getItemProps: (userProps?: Omit<HTMLProps<HTMLButtonElement>, 'selected' | 'active'>) => HTMLAttributes<HTMLElement>;
|
|
11
11
|
};
|
|
12
|
-
declare const
|
|
13
|
-
declare const MenuContextProvider: _$react.Context<MenuContext | null>;
|
|
12
|
+
declare const MenuContextProvider: _$react.Context<MenuContext | null>, useMenuContext: () => MenuContext;
|
|
14
13
|
declare const useMenuContent: () => {
|
|
15
14
|
contentProps: HTMLAttributes<HTMLElement>;
|
|
16
15
|
itemElementsRef: RefObject<(HTMLElement | null)[]>;
|
|
@@ -304,4 +303,4 @@ declare const useMenuItem: ({
|
|
|
304
303
|
};
|
|
305
304
|
declare const useMenuTrigger: () => (userProps?: HTMLProps<HTMLElement>) => HTMLAttributes<HTMLElement>;
|
|
306
305
|
//#endregion
|
|
307
|
-
export { MenuContextProvider, useMenuContent, useMenuItem, useMenuTrigger };
|
|
306
|
+
export { MenuContextProvider, useMenuContent, useMenuContext, useMenuItem, useMenuTrigger };
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createSafeContext } from "../../../helpers/create-safe-context.mjs";
|
|
2
3
|
import { useOpenContext } from "../popover/hooks.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { useMemo } from "react";
|
|
4
5
|
import { useListItem } from "@floating-ui/react";
|
|
5
6
|
//#region src/components/overlays/dropdown-menu/hooks.ts
|
|
6
|
-
const
|
|
7
|
-
const MenuContextProvider = MenuContext;
|
|
8
|
-
const useMenuContext = () => {
|
|
9
|
-
const menu = use(MenuContext);
|
|
10
|
-
if (!menu) throw new Error("useMenuContext must be used within a DropdownMenu.Root");
|
|
11
|
-
return menu;
|
|
12
|
-
};
|
|
7
|
+
const [MenuContextProvider, useMenuContext] = createSafeContext("useMenuContext must be used within a DropdownMenu.Root");
|
|
13
8
|
const useMenuContent = () => {
|
|
14
9
|
const menu = useMenuContext();
|
|
15
10
|
return useMemo(() => ({
|
|
@@ -42,4 +37,4 @@ const useMenuTrigger = () => {
|
|
|
42
37
|
return useMemo(() => menu.getTriggerProps, [menu]);
|
|
43
38
|
};
|
|
44
39
|
//#endregion
|
|
45
|
-
export { MenuContextProvider, useMenuContent, useMenuItem, useMenuTrigger };
|
|
40
|
+
export { MenuContextProvider, useMenuContent, useMenuContext, useMenuItem, useMenuTrigger };
|
|
@@ -16,7 +16,6 @@ type MenuContext = {
|
|
|
16
16
|
getContentProps: (userProps?: HTMLProps<HTMLElement>) => HTMLAttributes<HTMLElement>;
|
|
17
17
|
getItemProps: (userProps?: Omit<HTMLProps<HTMLElement>, 'selected' | 'active'>) => HTMLAttributes<HTMLElement>;
|
|
18
18
|
};
|
|
19
|
-
declare const MenuContext: _$react.Context<MenuContext | null>;
|
|
20
19
|
declare const MenuContextProvider: _$react.Context<MenuContext | null>;
|
|
21
20
|
declare const useMenuContent: () => {
|
|
22
21
|
options: Option[];
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createSafeContext } from "../../../helpers/create-safe-context.mjs";
|
|
2
3
|
import { useOpenContext } from "../popover/hooks.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { useMemo } from "react";
|
|
4
5
|
import { useListItem } from "@floating-ui/react";
|
|
5
6
|
//#region src/components/overlays/list-box/hooks.ts
|
|
6
|
-
const
|
|
7
|
-
const MenuContextProvider = MenuContext;
|
|
8
|
-
const useMenuContext = () => {
|
|
9
|
-
const menu = use(MenuContext);
|
|
10
|
-
if (!menu) throw new Error("useMenuContext must be used within a DropdownMenu.Root");
|
|
11
|
-
return menu;
|
|
12
|
-
};
|
|
7
|
+
const [MenuContextProvider, useMenuContext] = createSafeContext("useMenuContext must be used within a ListBox.Root");
|
|
13
8
|
const useMenuContent = () => {
|
|
14
9
|
const menu = useMenuContext();
|
|
15
10
|
return useMemo(() => ({
|
|
@@ -57,7 +57,7 @@ const Content = ({ helpContent }) => {
|
|
|
57
57
|
children: /* @__PURE__ */ jsx(Popover.Content, { renderItem: (props) => /* @__PURE__ */ jsxs("div", {
|
|
58
58
|
...props,
|
|
59
59
|
...contentProps,
|
|
60
|
-
className: "bg-bg-raised flex max-h-48 min-w-40 flex-col overflow-y-auto rounded-lg py-2 shadow-md",
|
|
60
|
+
className: "bg-bg-raised vertical:max-h-none vertical:min-w-0 vertical:max-w-48 vertical:min-h-40 vertical:overflow-x-auto vertical:overflow-y-visible flex max-h-48 min-w-40 flex-col overflow-y-auto rounded-lg py-2 shadow-md",
|
|
61
61
|
children: [helpContent, options.map(({ key, label }, idx) => /* @__PURE__ */ jsx(Item, {
|
|
62
62
|
index: idx,
|
|
63
63
|
label
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../helpers/cn.mjs";
|
|
3
3
|
import { ToastProvider } from "../../feedback/toast/provider.mjs";
|
|
4
|
+
import { PortalRootProvider } from "../../providers/portal-root.mjs";
|
|
4
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import * as motion from "motion/react-client";
|
|
@@ -149,7 +150,7 @@ const Modal = ({ ref, type = "center", defaultOpen, isOpen, onClose, children })
|
|
|
149
150
|
}, [isOpen, realRef]);
|
|
150
151
|
return /* @__PURE__ */ jsx(motion.dialog, {
|
|
151
152
|
animate: realDialogOpen ? "open" : "closed",
|
|
152
|
-
className: cn("bg-bg-raised text-fg-base shadow-md backdrop:bg-back-drop", type === "center" && "m-auto max-h-lg w-5/6 max-w-2xl rounded-lg", type === "bottom" && "mt-auto w-screen max-w-screen rounded-t-lg", type === "right" && "ml-auto h-svh max-h-none w-screen max-w-sm rounded-l-lg", type === "left" && "mr-auto h-svh max-h-none w-screen max-w-sm rounded-r-lg"),
|
|
153
|
+
className: cn("bg-bg-raised text-fg-base z-modal shadow-md backdrop:bg-back-drop", type === "center" && "m-auto max-h-lg w-5/6 max-w-2xl rounded-lg vertical:h-5/6 vertical:max-h-2xl vertical:w-auto vertical:max-w-lg", type === "bottom" && "mt-auto w-screen max-w-screen rounded-t-lg", type === "right" && "ml-auto h-svh max-h-none w-screen max-w-sm rounded-l-lg", type === "left" && "mr-auto h-svh max-h-none w-screen max-w-sm rounded-r-lg"),
|
|
153
154
|
exit: "closed",
|
|
154
155
|
initial: "closed",
|
|
155
156
|
onClick: (e) => {
|
|
@@ -158,10 +159,13 @@ const Modal = ({ ref, type = "center", defaultOpen, isOpen, onClose, children })
|
|
|
158
159
|
onClose: realOnClose,
|
|
159
160
|
ref: realRef,
|
|
160
161
|
variants: type === "center" ? centerVariants : type === "bottom" ? bottomVariants : type === "left" ? leftVariants : rightVariants,
|
|
161
|
-
children: /* @__PURE__ */ jsx(
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
children: /* @__PURE__ */ jsx(PortalRootProvider, {
|
|
163
|
+
value: realRef,
|
|
164
|
+
children: /* @__PURE__ */ jsx(ToastProvider, {
|
|
165
|
+
portalRef: realRef,
|
|
166
|
+
position: "absolute",
|
|
167
|
+
children
|
|
168
|
+
})
|
|
165
169
|
})
|
|
166
170
|
});
|
|
167
171
|
};
|
|
@@ -19,9 +19,7 @@ type PopoverContext = {
|
|
|
19
19
|
setContentRef: (node: HTMLElement | null) => void;
|
|
20
20
|
contentStyles: CSSProperties;
|
|
21
21
|
};
|
|
22
|
-
declare const
|
|
23
|
-
declare const PopoverProvider: _$react.Context<PopoverContext | null>;
|
|
24
|
-
declare const usePopoverContext: () => PopoverContext;
|
|
22
|
+
declare const PopoverProvider: _$react.Context<PopoverContext | null>, usePopoverContext: () => PopoverContext;
|
|
25
23
|
declare const useFloatingUIContext: () => FloatingContext;
|
|
26
24
|
declare const usePlacement: () => Placement;
|
|
27
25
|
declare const useOpenContext: () => {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { createSafeContext } from "../../../helpers/create-safe-context.mjs";
|
|
2
3
|
import { useClickAway } from "../../../hooks/click-away/index.mjs";
|
|
3
|
-
import {
|
|
4
|
+
import { useMemo, useRef } from "react";
|
|
4
5
|
//#region src/components/overlays/popover/hooks.ts
|
|
5
|
-
const
|
|
6
|
-
const PopoverProvider = PopoverContext;
|
|
7
|
-
const usePopoverContext = () => {
|
|
8
|
-
const popover = use(PopoverContext);
|
|
9
|
-
if (!popover) throw new Error("usePopoverContext must be used within a Popover.Root");
|
|
10
|
-
return popover;
|
|
11
|
-
};
|
|
6
|
+
const [PopoverProvider, usePopoverContext] = createSafeContext("usePopoverContext must be used within a Popover.Root");
|
|
12
7
|
const useFloatingUIContext = () => {
|
|
13
8
|
const popover = usePopoverContext();
|
|
14
9
|
return useMemo(() => popover.context, [popover]);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { cn } from "../../../helpers/cn.mjs";
|
|
2
3
|
import { useDisclosure } from "../../../hooks/disclosure/index.mjs";
|
|
4
|
+
import { useWritingMode } from "../../../hooks/writing-mode/index.mjs";
|
|
3
5
|
import { usePortalRoot } from "../../providers/portal-root.mjs";
|
|
4
|
-
import { PopoverProvider, useOpenContext, usePopoverContent, usePopoverTrigger } from "./hooks.mjs";
|
|
6
|
+
import { PopoverProvider, useOpenContext, usePopoverContent, usePopoverContext, usePopoverTrigger } from "./hooks.mjs";
|
|
5
7
|
import { useEffect, useId } from "react";
|
|
6
8
|
import { jsx } from "react/jsx-runtime";
|
|
7
9
|
import { FloatingFocusManager, FloatingPortal, autoUpdate, flip, offset, useFloating } from "@floating-ui/react";
|
|
@@ -66,14 +68,18 @@ const contentMotionVariants = {
|
|
|
66
68
|
};
|
|
67
69
|
const Content = ({ renderItem, motionVariants = contentMotionVariants }) => {
|
|
68
70
|
const { isOpen, trapFocus, context, setContentRef, contentStyles, itemProps } = usePopoverContent();
|
|
71
|
+
const { triggerRef } = usePopoverContext();
|
|
69
72
|
const root = usePortalRoot();
|
|
73
|
+
const protalProps = root ? { root } : {};
|
|
74
|
+
const writingClass = useWritingMode(triggerRef) === "vertical" ? "writing-v" : void 0;
|
|
70
75
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: isOpen && /* @__PURE__ */ jsx(FloatingPortal, {
|
|
71
|
-
...
|
|
76
|
+
...protalProps,
|
|
72
77
|
children: /* @__PURE__ */ jsx(FloatingFocusManager, {
|
|
73
78
|
context,
|
|
74
79
|
disabled: !trapFocus,
|
|
75
80
|
modal: false,
|
|
76
81
|
children: /* @__PURE__ */ jsx("div", {
|
|
82
|
+
className: cn("z-overlay", writingClass),
|
|
77
83
|
ref: setContentRef,
|
|
78
84
|
style: contentStyles,
|
|
79
85
|
children: /* @__PURE__ */ jsx(motion$1.div, {
|