@giddaa-housing/ui 0.1.0 → 1.0.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/README.md +18 -6
- package/css/base.css +37 -0
- package/css/components.css +135 -0
- package/css/generated/shared.css +1 -0
- package/css/giddaa.css +402 -0
- package/css/preset.css +77 -0
- package/css/styles.css +2 -0
- package/css/theme.css +255 -0
- package/dist/accordion.js +5 -35
- package/dist/accordion.js.map +1 -1
- package/dist/activity-timeline.d.ts +33 -0
- package/dist/activity-timeline.js +212 -0
- package/dist/activity-timeline.js.map +1 -0
- package/dist/alert.js +5 -35
- package/dist/alert.js.map +1 -1
- package/dist/auth-layout.d.ts +23 -0
- package/dist/auth-layout.js +304 -0
- package/dist/auth-layout.js.map +1 -0
- package/dist/avatar.js +10 -142
- package/dist/avatar.js.map +1 -1
- package/dist/badge.d.ts +3 -2
- package/dist/badge.js +6 -114
- package/dist/badge.js.map +1 -1
- package/dist/bar-chart.d.ts +101 -77
- package/dist/bar-chart.js +142 -220
- package/dist/bar-chart.js.map +1 -1
- package/dist/breadcrumb.js +5 -35
- package/dist/breadcrumb.js.map +1 -1
- package/dist/bullet-chart.js +15 -48
- package/dist/bullet-chart.js.map +1 -1
- package/dist/button-group.js +14 -90
- package/dist/button-group.js.map +1 -1
- package/dist/button.d.ts +5 -5
- package/dist/button.js +7 -140
- package/dist/button.js.map +1 -1
- package/dist/calendar.js +12 -287
- package/dist/calendar.js.map +1 -1
- package/dist/card.js +5 -35
- package/dist/card.js.map +1 -1
- package/dist/carousel.js +12 -386
- package/dist/carousel.js.map +1 -1
- package/dist/chart.js +16 -480
- package/dist/chart.js.map +1 -1
- package/dist/checkbox.d.ts +1 -1
- package/dist/checkbox.js +13 -48
- package/dist/checkbox.js.map +1 -1
- package/dist/chunk-322YCNVL.js +278 -0
- package/dist/chunk-322YCNVL.js.map +1 -0
- package/dist/chunk-3ACQVT7A.js +25 -0
- package/dist/chunk-3ACQVT7A.js.map +1 -0
- package/dist/chunk-3T65TLJX.js +334 -0
- package/dist/chunk-3T65TLJX.js.map +1 -0
- package/dist/chunk-6ZSGQHH2.js +192 -0
- package/dist/chunk-6ZSGQHH2.js.map +1 -0
- package/dist/chunk-7TBMLFGW.js +41 -0
- package/dist/chunk-7TBMLFGW.js.map +1 -0
- package/dist/chunk-B4H6RNDH.js +135 -0
- package/dist/chunk-B4H6RNDH.js.map +1 -0
- package/dist/chunk-BUXCGZ6X.js +219 -0
- package/dist/chunk-BUXCGZ6X.js.map +1 -0
- package/dist/chunk-CHII2QHH.js +58 -0
- package/dist/chunk-CHII2QHH.js.map +1 -0
- package/dist/chunk-DMNOXRRW.js +147 -0
- package/dist/chunk-DMNOXRRW.js.map +1 -0
- package/dist/chunk-EFSOSSIC.js +130 -0
- package/dist/chunk-EFSOSSIC.js.map +1 -0
- package/dist/chunk-FZDSVMKY.js +363 -0
- package/dist/chunk-FZDSVMKY.js.map +1 -0
- package/dist/chunk-GJOFIJS3.js +246 -0
- package/dist/chunk-GJOFIJS3.js.map +1 -0
- package/dist/chunk-HL3ZSYES.js +23 -0
- package/dist/chunk-HL3ZSYES.js.map +1 -0
- package/dist/chunk-JVLUBAPB.js +129 -0
- package/dist/chunk-JVLUBAPB.js.map +1 -0
- package/dist/chunk-KDPYSOYZ.js +64 -0
- package/dist/chunk-KDPYSOYZ.js.map +1 -0
- package/dist/chunk-KSMDANKI.js +43 -0
- package/dist/chunk-KSMDANKI.js.map +1 -0
- package/dist/chunk-MEKCCOP5.js +46 -0
- package/dist/chunk-MEKCCOP5.js.map +1 -0
- package/dist/chunk-NOFXVRWL.js +451 -0
- package/dist/chunk-NOFXVRWL.js.map +1 -0
- package/dist/chunk-PC5MHNVA.js +171 -0
- package/dist/chunk-PC5MHNVA.js.map +1 -0
- package/dist/chunk-QKAQZ2GU.js +122 -0
- package/dist/chunk-QKAQZ2GU.js.map +1 -0
- package/dist/chunk-QZHSHSVV.js +26 -0
- package/dist/chunk-QZHSHSVV.js.map +1 -0
- package/dist/chunk-RBMK26XD.js +19 -0
- package/dist/chunk-RBMK26XD.js.map +1 -0
- package/dist/chunk-SFNJGF6M.js +262 -0
- package/dist/chunk-SFNJGF6M.js.map +1 -0
- package/dist/chunk-UJJNLGTM.js +112 -0
- package/dist/chunk-UJJNLGTM.js.map +1 -0
- package/dist/chunk-VGR4ZWJ3.js +418 -0
- package/dist/chunk-VGR4ZWJ3.js.map +1 -0
- package/dist/chunk-XG47P6D4.js +99 -0
- package/dist/chunk-XG47P6D4.js.map +1 -0
- package/dist/chunk-XZZAHNVM.js +21 -0
- package/dist/chunk-XZZAHNVM.js.map +1 -0
- package/dist/chunk-Y4TTYVNE.js +36 -0
- package/dist/chunk-Y4TTYVNE.js.map +1 -0
- package/dist/chunk-YDWIHW6Q.js +69 -0
- package/dist/chunk-YDWIHW6Q.js.map +1 -0
- package/dist/collapsible.js +6 -35
- package/dist/collapsible.js.map +1 -1
- package/dist/combobox.js +26 -694
- package/dist/combobox.js.map +1 -1
- package/dist/cta.d.ts +66 -0
- package/dist/cta.js +358 -0
- package/dist/cta.js.map +1 -0
- package/dist/currency-selector.d.ts +42 -0
- package/dist/currency-selector.js +192 -0
- package/dist/currency-selector.js.map +1 -0
- package/dist/date-picker.d.ts +18 -10
- package/dist/date-picker.js +105 -430
- package/dist/date-picker.js.map +1 -1
- package/dist/details-card.d.ts +19 -0
- package/dist/details-card.js +267 -0
- package/dist/details-card.js.map +1 -0
- package/dist/dialog.js +36 -146
- package/dist/dialog.js.map +1 -1
- package/dist/dropdown-menu.d.ts +1 -1
- package/dist/dropdown-menu.js +20 -358
- package/dist/dropdown-menu.js.map +1 -1
- package/dist/dropzone.js +13 -40
- package/dist/dropzone.js.map +1 -1
- package/dist/editorial-card.d.ts +29 -0
- package/dist/editorial-card.js +311 -0
- package/dist/editorial-card.js.map +1 -0
- package/dist/empty-state.js +5 -35
- package/dist/empty-state.js.map +1 -1
- package/dist/field.js +30 -135
- package/dist/field.js.map +1 -1
- package/dist/footer.d.ts +47 -0
- package/dist/footer.js +430 -0
- package/dist/footer.js.map +1 -0
- package/dist/funnel-chart.js +42 -415
- package/dist/funnel-chart.js.map +1 -1
- package/dist/gallery-indicator.d.ts +18 -0
- package/dist/gallery-indicator.js +12 -0
- package/dist/gallery-indicator.js.map +1 -0
- package/dist/heatmap-chart.d.ts +98 -0
- package/dist/heatmap-chart.js +248 -0
- package/dist/heatmap-chart.js.map +1 -0
- package/dist/infotip.d.ts +11 -0
- package/dist/infotip.js +66 -0
- package/dist/infotip.js.map +1 -0
- package/dist/input-group.d.ts +2 -1
- package/dist/input-group.js +15 -371
- package/dist/input-group.js.map +1 -1
- package/dist/input-size-context.js +5 -19
- package/dist/input-size-context.js.map +1 -1
- package/dist/input.js +6 -78
- package/dist/input.js.map +1 -1
- package/dist/item.js +5 -35
- package/dist/item.js.map +1 -1
- package/dist/kpi-card.js +12 -52
- package/dist/kpi-card.js.map +1 -1
- package/dist/label.js +5 -64
- package/dist/label.js.map +1 -1
- package/dist/line-chart.js +9 -166
- package/dist/line-chart.js.map +1 -1
- package/dist/logo.js +4 -141
- package/dist/logo.js.map +1 -1
- package/dist/map-indicator.d.ts +13 -0
- package/dist/map-indicator.js +109 -0
- package/dist/map-indicator.js.map +1 -0
- package/dist/match.d.ts +16 -0
- package/dist/match.js +113 -0
- package/dist/match.js.map +1 -0
- package/dist/media-gallery-hero.d.ts +60 -0
- package/dist/media-gallery-hero.js +362 -0
- package/dist/media-gallery-hero.js.map +1 -0
- package/dist/media-player.d.ts +60 -0
- package/dist/media-player.js +1394 -0
- package/dist/media-player.js.map +1 -0
- package/dist/number-input.js +30 -325
- package/dist/number-input.js.map +1 -1
- package/dist/page-header.js +4 -32
- package/dist/page-header.js.map +1 -1
- package/dist/pagination.d.ts +1 -0
- package/dist/pagination.js +27 -161
- package/dist/pagination.js.map +1 -1
- package/dist/password-input.d.ts +1 -0
- package/dist/password-input.js +21 -319
- package/dist/password-input.js.map +1 -1
- package/dist/phone-input.d.ts +2 -1
- package/dist/phone-input.js +148 -359
- package/dist/phone-input.js.map +1 -1
- package/dist/photo-gallery.d.ts +1 -1
- package/dist/photo-gallery.js +97 -393
- package/dist/photo-gallery.js.map +1 -1
- package/dist/pie-chart.js +17 -52
- package/dist/pie-chart.js.map +1 -1
- package/dist/popover.js +13 -158
- package/dist/popover.js.map +1 -1
- package/dist/price-tag.d.ts +35 -0
- package/dist/price-tag.js +178 -0
- package/dist/price-tag.js.map +1 -0
- package/dist/progress.d.ts +5 -2
- package/dist/progress.js +14 -303
- package/dist/progress.js.map +1 -1
- package/dist/property-listing-card.d.ts +32 -0
- package/dist/property-listing-card.js +235 -0
- package/dist/property-listing-card.js.map +1 -0
- package/dist/radar-chart.d.ts +110 -0
- package/dist/radar-chart.js +147 -0
- package/dist/radar-chart.js.map +1 -0
- package/dist/radio-group.js +15 -50
- package/dist/radio-group.js.map +1 -1
- package/dist/review-block.d.ts +20 -0
- package/dist/review-block.js +10 -0
- package/dist/review-block.js.map +1 -0
- package/dist/rich-text-editor.js +172 -433
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/scatter-chart.d.ts +142 -0
- package/dist/scatter-chart.js +252 -0
- package/dist/scatter-chart.js.map +1 -0
- package/dist/search-input.d.ts +1 -0
- package/dist/search-input.js +22 -320
- package/dist/search-input.js.map +1 -1
- package/dist/select.js +15 -292
- package/dist/select.js.map +1 -1
- package/dist/separator.js +5 -68
- package/dist/separator.js.map +1 -1
- package/dist/sheet.js +14 -271
- package/dist/sheet.js.map +1 -1
- package/dist/sidebar.d.ts +1 -1
- package/dist/sidebar.js +89 -494
- package/dist/sidebar.js.map +1 -1
- package/dist/size-context.js +5 -17
- package/dist/size-context.js.map +1 -1
- package/dist/skeleton.js +4 -44
- package/dist/skeleton.js.map +1 -1
- package/dist/slider.d.ts +28 -0
- package/dist/slider.js +152 -0
- package/dist/slider.js.map +1 -0
- package/dist/sparkline.js +33 -341
- package/dist/sparkline.js.map +1 -1
- package/dist/stepper.js +5 -35
- package/dist/stepper.js.map +1 -1
- package/dist/styles.css +9593 -2
- package/dist/switch.js +13 -48
- package/dist/switch.js.map +1 -1
- package/dist/tab-list.js +35 -306
- package/dist/tab-list.js.map +1 -1
- package/dist/table.js +5 -32
- package/dist/table.js.map +1 -1
- package/dist/tabs.js +10 -150
- package/dist/tabs.js.map +1 -1
- package/dist/tag.d.ts +7 -6
- package/dist/tag.js +101 -97
- package/dist/tag.js.map +1 -1
- package/dist/testimonial-block.d.ts +34 -0
- package/dist/testimonial-block.js +377 -0
- package/dist/testimonial-block.js.map +1 -0
- package/dist/textarea.js +6 -73
- package/dist/textarea.js.map +1 -1
- package/dist/time-picker.js +119 -279
- package/dist/time-picker.js.map +1 -1
- package/dist/toast.js +27 -132
- package/dist/toast.js.map +1 -1
- package/dist/tooltip.d.ts +5 -5
- package/dist/tooltip.js +7 -90
- package/dist/tooltip.js.map +1 -1
- package/dist/tree-map.js +41 -414
- package/dist/tree-map.js.map +1 -1
- package/dist/waterfall-chart.d.ts +129 -0
- package/dist/waterfall-chart.js +577 -0
- package/dist/waterfall-chart.js.map +1 -0
- package/package.json +98 -28
- package/dist/base.css +0 -32
- package/dist/files/red-hat-display-latin-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-900-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-300-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-400-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-500-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-600-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-700-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-800-normal.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-italic.woff2 +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff +0 -0
- package/dist/files/red-hat-display-latin-ext-900-normal.woff2 +0 -0
- package/dist/index.d.ts +0 -87
- package/dist/index.js +0 -10448
- package/dist/index.js.map +0 -1
- package/dist/red-hat-display.css +0 -2
- package/dist/theme/giddaa.css +0 -2
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
Popover,
|
|
4
|
+
PopoverContent,
|
|
5
|
+
PopoverTrigger
|
|
6
|
+
} from "./chunk-JVLUBAPB.js";
|
|
7
|
+
import {
|
|
8
|
+
DropdownMenu,
|
|
9
|
+
DropdownMenuContent,
|
|
10
|
+
DropdownMenuRadioGroup,
|
|
11
|
+
DropdownMenuRadioItem,
|
|
12
|
+
DropdownMenuTrigger
|
|
13
|
+
} from "./chunk-3T65TLJX.js";
|
|
14
|
+
import {
|
|
15
|
+
Input
|
|
16
|
+
} from "./chunk-MEKCCOP5.js";
|
|
17
|
+
import "./chunk-3ACQVT7A.js";
|
|
18
|
+
import {
|
|
19
|
+
Button
|
|
20
|
+
} from "./chunk-B4H6RNDH.js";
|
|
21
|
+
import {
|
|
22
|
+
useComponentSize
|
|
23
|
+
} from "./chunk-HL3ZSYES.js";
|
|
24
|
+
import {
|
|
25
|
+
cn
|
|
26
|
+
} from "./chunk-Y4TTYVNE.js";
|
|
27
|
+
|
|
28
|
+
// src/rich-text-editor.tsx
|
|
2
29
|
import { Color } from "@tiptap/extension-color";
|
|
3
30
|
import { Image } from "@tiptap/extension-image";
|
|
4
31
|
import { Placeholder } from "@tiptap/extension-placeholder";
|
|
@@ -26,358 +53,7 @@ import {
|
|
|
26
53
|
Undo2
|
|
27
54
|
} from "lucide-react";
|
|
28
55
|
import * as React from "react";
|
|
29
|
-
|
|
30
|
-
// src/lib/cn.ts
|
|
31
|
-
import { clsx } from "clsx";
|
|
32
|
-
import { extendTailwindMerge } from "tailwind-merge";
|
|
33
|
-
var twMerge = extendTailwindMerge({
|
|
34
|
-
extend: {
|
|
35
|
-
classGroups: {
|
|
36
|
-
"font-size": [
|
|
37
|
-
{
|
|
38
|
-
text: [
|
|
39
|
-
"gdt-display",
|
|
40
|
-
"gdt-h1",
|
|
41
|
-
"gdt-h2",
|
|
42
|
-
"gdt-h3",
|
|
43
|
-
"gdt-h4",
|
|
44
|
-
"gdt-h5",
|
|
45
|
-
"gdt-xl",
|
|
46
|
-
"gdt-lg",
|
|
47
|
-
"gdt-md",
|
|
48
|
-
"gdt-sm",
|
|
49
|
-
"gdt-xs",
|
|
50
|
-
"gdt-subtext",
|
|
51
|
-
"gdt-capitalized"
|
|
52
|
-
]
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
function cn(...inputs) {
|
|
59
|
-
return twMerge(clsx(inputs));
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// src/components/ui/button.tsx
|
|
63
|
-
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
64
|
-
import { cva } from "class-variance-authority";
|
|
65
|
-
import { Loader } from "lucide-react";
|
|
66
|
-
|
|
67
|
-
// src/components/ui/size-context.tsx
|
|
68
|
-
import { createContext, useContext } from "react";
|
|
69
|
-
import { Fragment, jsx } from "react/jsx-runtime";
|
|
70
|
-
var SizeContext = createContext(void 0);
|
|
71
|
-
function SizeProvider({
|
|
72
|
-
children,
|
|
73
|
-
size
|
|
74
|
-
}) {
|
|
75
|
-
if (!size) {
|
|
76
|
-
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
77
|
-
}
|
|
78
|
-
return /* @__PURE__ */ jsx(SizeContext.Provider, { value: size, children });
|
|
79
|
-
}
|
|
80
|
-
function useComponentSize(size, fallback = "md") {
|
|
81
|
-
const inheritedSize = useContext(SizeContext);
|
|
82
|
-
return size ?? inheritedSize ?? fallback;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// src/components/ui/button.tsx
|
|
86
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
87
|
-
var buttonVariants = cva(
|
|
88
|
-
"group/button inline-flex shrink-0 items-center justify-center rounded-full bg-clip-padding whitespace-nowrap font-bold transition-[background-color,color,border-color,box-shadow,transform] outline-none select-none focus-visible:border-line-focus focus-visible:shadow-[0px_0px_0px_2px_var(--color-line-focus)] active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-invalid:border-line-danger aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
89
|
-
{
|
|
90
|
-
variants: {
|
|
91
|
-
variant: {
|
|
92
|
-
primary: "bg-action-primary text-fg-on-brand hover:bg-action-primary-hover active:bg-action-primary-pressed",
|
|
93
|
-
"primary-outline": "border-2 border-action-primary bg-transparent text-fg-brand hover:bg-surface-brand-subtle active:bg-surface-brand-subtle data-focused:bg-surface-brand-subtle data-pressed:bg-surface-brand-subtle",
|
|
94
|
-
secondary: "bg-surface-brand-subtle text-fg-brand hover:bg-action-primary-hover hover:text-fg-on-brand active:bg-action-primary-pressed active:text-fg-on-brand data-focused:bg-action-primary-hover data-pressed:bg-action-primary-pressed data-focused:text-fg-on-brand data-pressed:text-fg-on-brand",
|
|
95
|
-
"secondary-outline": "border-2 border-action-secondary bg-transparent text-fg-brand hover:bg-surface-brand-subtle active:bg-surface-brand-subtle data-focused:bg-surface-brand-subtle data-pressed:bg-surface-brand-subtle",
|
|
96
|
-
tertiary: "bg-action-tertiary text-fg-primary hover:bg-action-tertiary-hover active:bg-action-tertiary-pressed data-focused:bg-action-tertiary-hover data-pressed:bg-action-tertiary-pressed",
|
|
97
|
-
"tertiary-outline": "border border-line-strong bg-transparent text-fg-primary hover:bg-surface active:bg-surface-raised data-focused:bg-surface data-pressed:bg-surface-raised",
|
|
98
|
-
ghost: "bg-transparent text-fg-primary hover:bg-surface active:bg-surface-raised data-focused:bg-surface data-pressed:bg-surface-raised",
|
|
99
|
-
danger: "bg-action-danger text-fg-on-brand hover:bg-action-danger-hover active:bg-action-danger-pressed data-focused:bg-action-danger-hover data-pressed:bg-action-danger-pressed",
|
|
100
|
-
"glass-overlay": "bg-surface-glass-overlay-button text-fg-on-brand",
|
|
101
|
-
"link-brand": "border-transparent bg-transparent px-0 text-fg-brand hover:underline active:underline active:opacity-70",
|
|
102
|
-
"link-neutral": "border-transparent bg-transparent px-0 text-fg-secondary hover:underline active:underline active:opacity-70"
|
|
103
|
-
},
|
|
104
|
-
size: {
|
|
105
|
-
sm: "h-8 gap-2 px-3.5 text-gdt-xs has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-3.5",
|
|
106
|
-
md: "h-10 gap-2 px-4.5 text-gdt-sm has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
|
|
107
|
-
lg: "h-12.5 gap-2.5 px-5.5 text-gdt-md has-data-[icon=inline-end]:pr-5 has-data-[icon=inline-start]:pl-5 [&_svg:not([class*='size-'])]:size-4.5",
|
|
108
|
-
xl: "h-14 gap-3 px-6.5 text-gdt-lg has-data-[icon=inline-end]:pr-6 has-data-[icon=inline-start]:pl-6 [&_svg:not([class*='size-'])]:size-5",
|
|
109
|
-
icon: "size-10",
|
|
110
|
-
"icon-xs": "size-6 text-gdt-xs [&_svg:not([class*='size-'])]:size-3",
|
|
111
|
-
"icon-sm": "size-8 text-gdt-sm [&_svg:not([class*='size-'])]:size-3.5",
|
|
112
|
-
"icon-lg": "size-12.5 text-gdt-md [&_svg:not([class*='size-'])]:size-4.5",
|
|
113
|
-
"icon-xl": "size-14 text-gdt-lg [&_svg:not([class*='size-'])]:size-5"
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
defaultVariants: {
|
|
117
|
-
variant: "primary",
|
|
118
|
-
size: "md"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
);
|
|
122
|
-
function Button({
|
|
123
|
-
className,
|
|
124
|
-
variant = "primary",
|
|
125
|
-
size,
|
|
126
|
-
isLoading = false,
|
|
127
|
-
children,
|
|
128
|
-
disabled = false,
|
|
129
|
-
...props
|
|
130
|
-
}) {
|
|
131
|
-
const inheritedSize = useComponentSize();
|
|
132
|
-
const resolvedSize = size ?? inheritedSize;
|
|
133
|
-
const _disabled = disabled || isLoading;
|
|
134
|
-
return /* @__PURE__ */ jsxs(
|
|
135
|
-
ButtonPrimitive,
|
|
136
|
-
{
|
|
137
|
-
"data-slot": "button",
|
|
138
|
-
className: cn(buttonVariants({ variant, size: resolvedSize, className })),
|
|
139
|
-
disabled: _disabled,
|
|
140
|
-
...props,
|
|
141
|
-
children: [
|
|
142
|
-
isLoading && /* @__PURE__ */ jsx2(Loader, { className: "size-4 animate-spin" }),
|
|
143
|
-
" ",
|
|
144
|
-
children
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// src/components/ui/dropdown-menu.tsx
|
|
151
|
-
import { Menu as MenuPrimitive } from "@base-ui/react/menu";
|
|
152
|
-
import { cva as cva2 } from "class-variance-authority";
|
|
153
|
-
import { CheckIcon, ChevronRightIcon } from "lucide-react";
|
|
154
|
-
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
155
|
-
function DropdownMenu({
|
|
156
|
-
children,
|
|
157
|
-
size,
|
|
158
|
-
...props
|
|
159
|
-
}) {
|
|
160
|
-
return /* @__PURE__ */ jsx3(SizeProvider, { size, children: /* @__PURE__ */ jsx3(MenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props, children }) });
|
|
161
|
-
}
|
|
162
|
-
function DropdownMenuTrigger({ ...props }) {
|
|
163
|
-
return /* @__PURE__ */ jsx3(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", ...props });
|
|
164
|
-
}
|
|
165
|
-
var dropdownMenuContentVariants = cva2(
|
|
166
|
-
"relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto border border-line-subtle bg-canvas text-fg-primary shadow-(--elevation-e1-shadow) duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95",
|
|
167
|
-
{
|
|
168
|
-
variants: {
|
|
169
|
-
size: {
|
|
170
|
-
sm: "rounded-lg p-1",
|
|
171
|
-
md: "rounded-xl p-1.5",
|
|
172
|
-
lg: "rounded-[18px] p-2"
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
defaultVariants: {
|
|
176
|
-
size: "md"
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
);
|
|
180
|
-
var dropdownMenuItemVariants = cva2(
|
|
181
|
-
"group/dropdown-menu-item relative flex w-full cursor-pointer items-center font-normal text-fg-primary outline-none transition-colors select-none focus:bg-surface focus:text-fg-primary data-highlighted:bg-surface data-highlighted:text-fg-primary data-[variant=destructive]:text-fg-danger data-[variant=destructive]:focus:bg-surface-danger-subtle data-[variant=destructive]:focus:text-fg-danger data-[variant=destructive]:data-highlighted:bg-surface-danger-subtle data-[variant=destructive]:data-highlighted:text-fg-danger data-disabled:pointer-events-none data-disabled:text-fg-caption-placeholder data-disabled:opacity-100 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[variant=destructive]:[&_svg]:text-fg-danger",
|
|
182
|
-
{
|
|
183
|
-
variants: {
|
|
184
|
-
size: {
|
|
185
|
-
sm: "gap-1.5 rounded-md px-3 py-1.5 text-gdt-xs [&_svg:not([class*='size-'])]:size-3.5",
|
|
186
|
-
md: "gap-2 rounded-md px-4 py-2 text-gdt-sm [&_svg:not([class*='size-'])]:size-4",
|
|
187
|
-
lg: "gap-2.5 rounded-md px-4 py-2.5 text-gdt-md [&_svg:not([class*='size-'])]:size-4.5"
|
|
188
|
-
}
|
|
189
|
-
},
|
|
190
|
-
defaultVariants: {
|
|
191
|
-
size: "md"
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
);
|
|
195
|
-
var dropdownMenuLabelVariants = cva2(
|
|
196
|
-
"font-medium text-fg-secondary data-inset:pl-8",
|
|
197
|
-
{
|
|
198
|
-
variants: {
|
|
199
|
-
size: {
|
|
200
|
-
sm: "px-3 py-1 text-gdt-xs",
|
|
201
|
-
md: "px-3 py-1 text-gdt-xs",
|
|
202
|
-
lg: "px-4 py-1.5 text-gdt-sm"
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
defaultVariants: {
|
|
206
|
-
size: "md"
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
);
|
|
210
|
-
function DropdownMenuContent({
|
|
211
|
-
align = "start",
|
|
212
|
-
alignOffset = 0,
|
|
213
|
-
side = "bottom",
|
|
214
|
-
sideOffset = 6,
|
|
215
|
-
className,
|
|
216
|
-
...props
|
|
217
|
-
}) {
|
|
218
|
-
const resolvedSize = useComponentSize();
|
|
219
|
-
return /* @__PURE__ */ jsx3(MenuPrimitive.Portal, { children: /* @__PURE__ */ jsx3(
|
|
220
|
-
MenuPrimitive.Positioner,
|
|
221
|
-
{
|
|
222
|
-
className: "isolate z-50 outline-none",
|
|
223
|
-
align,
|
|
224
|
-
alignOffset,
|
|
225
|
-
side,
|
|
226
|
-
sideOffset,
|
|
227
|
-
children: /* @__PURE__ */ jsx3(
|
|
228
|
-
MenuPrimitive.Popup,
|
|
229
|
-
{
|
|
230
|
-
"data-slot": "dropdown-menu-content",
|
|
231
|
-
"data-size": resolvedSize,
|
|
232
|
-
className: cn(
|
|
233
|
-
dropdownMenuContentVariants({ size: resolvedSize }),
|
|
234
|
-
className
|
|
235
|
-
),
|
|
236
|
-
...props
|
|
237
|
-
}
|
|
238
|
-
)
|
|
239
|
-
}
|
|
240
|
-
) });
|
|
241
|
-
}
|
|
242
|
-
function DropdownMenuRadioGroup({ ...props }) {
|
|
243
|
-
return /* @__PURE__ */ jsx3(
|
|
244
|
-
MenuPrimitive.RadioGroup,
|
|
245
|
-
{
|
|
246
|
-
"data-slot": "dropdown-menu-radio-group",
|
|
247
|
-
...props
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
function DropdownMenuRadioItem({
|
|
252
|
-
className,
|
|
253
|
-
children,
|
|
254
|
-
inset,
|
|
255
|
-
...props
|
|
256
|
-
}) {
|
|
257
|
-
const resolvedSize = useComponentSize();
|
|
258
|
-
return /* @__PURE__ */ jsxs2(
|
|
259
|
-
MenuPrimitive.RadioItem,
|
|
260
|
-
{
|
|
261
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
262
|
-
"data-inset": inset,
|
|
263
|
-
"data-size": resolvedSize,
|
|
264
|
-
className: cn(
|
|
265
|
-
dropdownMenuItemVariants({ size: resolvedSize }),
|
|
266
|
-
"pr-10 data-inset:pl-8",
|
|
267
|
-
className
|
|
268
|
-
),
|
|
269
|
-
...props,
|
|
270
|
-
children: [
|
|
271
|
-
/* @__PURE__ */ jsx3(
|
|
272
|
-
"span",
|
|
273
|
-
{
|
|
274
|
-
className: "pointer-events-none absolute right-3 flex items-center justify-center text-fg-brand",
|
|
275
|
-
"data-slot": "dropdown-menu-radio-item-indicator",
|
|
276
|
-
children: /* @__PURE__ */ jsx3(MenuPrimitive.RadioItemIndicator, { children: /* @__PURE__ */ jsx3(CheckIcon, {}) })
|
|
277
|
-
}
|
|
278
|
-
),
|
|
279
|
-
children
|
|
280
|
-
]
|
|
281
|
-
}
|
|
282
|
-
);
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// src/components/ui/input.tsx
|
|
286
|
-
import { Input as InputPrimitive } from "@base-ui/react/input";
|
|
287
|
-
import { cva as cva3 } from "class-variance-authority";
|
|
288
|
-
|
|
289
|
-
// src/components/ui/input-size-context.tsx
|
|
290
|
-
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
291
|
-
import { Fragment as Fragment2, jsx as jsx4 } from "react/jsx-runtime";
|
|
292
|
-
var InputSizeContext = createContext2(
|
|
293
|
-
void 0
|
|
294
|
-
);
|
|
295
|
-
function useInputComponentSize(size, fallback = "md") {
|
|
296
|
-
const inheritedSize = useContext2(InputSizeContext);
|
|
297
|
-
return size ?? inheritedSize ?? fallback;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
// src/components/ui/input.tsx
|
|
301
|
-
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
302
|
-
var inputVariants = cva3(
|
|
303
|
-
"flex w-full min-w-0 rounded-full border border-line bg-canvas text-fg-primary transition-[background-color,border-color,box-shadow,color] outline-none file:inline-flex file:border-0 file:bg-transparent file:font-normal file:text-fg-primary placeholder:text-fg-muted hover:border-line-strong focus-visible:border-line-focus focus-visible:inset-ring-1 inset-ring-line-focus disabled:pointer-events-none disabled:cursor-not-allowed disabled:border-line-subtle disabled:bg-surface disabled:text-fg-muted disabled:placeholder:text-fg-muted aria-invalid:border-line-danger aria-invalid:text-fg-danger aria-invalid:placeholder:text-fg-danger aria-invalid:shadow-none",
|
|
304
|
-
{
|
|
305
|
-
variants: {
|
|
306
|
-
size: {
|
|
307
|
-
sm: "h-8 px-3 text-gdt-xs font-normal file:text-gdt-xs",
|
|
308
|
-
md: "h-10 px-3.5 text-gdt-sm font-normal file:text-gdt-sm",
|
|
309
|
-
lg: "h-12 px-4 text-gdt-md font-normal file:text-gdt-md",
|
|
310
|
-
xl: "h-14 px-4.5 text-gdt-lg font-normal file:text-gdt-lg"
|
|
311
|
-
}
|
|
312
|
-
},
|
|
313
|
-
defaultVariants: {
|
|
314
|
-
size: "md"
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
);
|
|
318
|
-
function Input({ className, size, type, ...props }) {
|
|
319
|
-
const resolvedSize = useInputComponentSize(size);
|
|
320
|
-
return /* @__PURE__ */ jsx5(
|
|
321
|
-
InputPrimitive,
|
|
322
|
-
{
|
|
323
|
-
type,
|
|
324
|
-
"data-slot": "input",
|
|
325
|
-
"data-size": resolvedSize,
|
|
326
|
-
className: cn(inputVariants({ size: resolvedSize }), className),
|
|
327
|
-
...props
|
|
328
|
-
}
|
|
329
|
-
);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
// src/components/ui/popover.tsx
|
|
333
|
-
import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
|
|
334
|
-
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
335
|
-
function Popover({ ...props }) {
|
|
336
|
-
return /* @__PURE__ */ jsx6(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
337
|
-
}
|
|
338
|
-
function PopoverTrigger({ ...props }) {
|
|
339
|
-
return /* @__PURE__ */ jsx6(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
340
|
-
}
|
|
341
|
-
function PopoverContent({
|
|
342
|
-
className,
|
|
343
|
-
align = "center",
|
|
344
|
-
alignOffset = 0,
|
|
345
|
-
side = "bottom",
|
|
346
|
-
sideOffset = 6,
|
|
347
|
-
showArrow = true,
|
|
348
|
-
size = "md",
|
|
349
|
-
children,
|
|
350
|
-
...props
|
|
351
|
-
}) {
|
|
352
|
-
return /* @__PURE__ */ jsx6(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx6(
|
|
353
|
-
PopoverPrimitive.Positioner,
|
|
354
|
-
{
|
|
355
|
-
align,
|
|
356
|
-
alignOffset,
|
|
357
|
-
side,
|
|
358
|
-
sideOffset,
|
|
359
|
-
className: "isolate z-50",
|
|
360
|
-
children: /* @__PURE__ */ jsxs3(
|
|
361
|
-
PopoverPrimitive.Popup,
|
|
362
|
-
{
|
|
363
|
-
"data-slot": "popover-content",
|
|
364
|
-
className: cn(
|
|
365
|
-
"z-50 relative flex w-72 max-w-[calc(100vw-2rem)] origin-(--transform-origin) flex-col rounded-lg border-0 bg-surface-overlay py-4 text-gdt-sm text-fg-primary shadow-2 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 has-[&_[data-slot=popover-footer]]:pb-0",
|
|
366
|
-
className
|
|
367
|
-
),
|
|
368
|
-
...props,
|
|
369
|
-
children: [
|
|
370
|
-
/* @__PURE__ */ jsx6(SizeProvider, { size, children }),
|
|
371
|
-
showArrow ? /* @__PURE__ */ jsx6(PopoverPrimitive.Arrow, { className: "relative block w-3 h-1.5 overflow-clip data-[side=bottom]:top-[-6px] data-[side=left]:right-[-9px] data-[side=left]:rotate-90 data-[side=right]:left-[-9px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-6px] data-[side=top]:rotate-180 before:content-[''] before:absolute before:bottom-0 before:left-1/2 before:w-[calc(6px*sqrt(2))] before:h-[calc(6px*sqrt(2))] before:bg-surface-overlay before:border before:border-line before:[transform:translate(-50%,50%)_rotate(45deg)]" }) : null
|
|
372
|
-
]
|
|
373
|
-
}
|
|
374
|
-
)
|
|
375
|
-
}
|
|
376
|
-
) });
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
// src/components/ui/rich-text-editor.tsx
|
|
380
|
-
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
56
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
381
57
|
var SIZES = {
|
|
382
58
|
sm: {
|
|
383
59
|
width: "max-w-[420px]",
|
|
@@ -414,13 +90,13 @@ var SIZES = {
|
|
|
414
90
|
}
|
|
415
91
|
};
|
|
416
92
|
var TEXT_COLORS = [
|
|
417
|
-
{ label: "Default", value: "" },
|
|
418
|
-
{ label: "Forest", value: "#2f5a2c" },
|
|
419
|
-
{ label: "Brass", value: "#b8861a" },
|
|
420
|
-
{ label: "Clay", value: "#b2542b" },
|
|
421
|
-
{ label: "Moss", value: "#4e4d29" },
|
|
422
|
-
{ label: "Stone", value: "#5c5648" },
|
|
423
|
-
{ label: "Ink", value: "#1f1c18" }
|
|
93
|
+
{ label: "Default", value: "", swatch: "" },
|
|
94
|
+
{ label: "Forest", value: "#2f5a2c", swatch: "var(--color-forest-500)" },
|
|
95
|
+
{ label: "Brass", value: "#b8861a", swatch: "var(--color-brass-400)" },
|
|
96
|
+
{ label: "Clay", value: "#b2542b", swatch: "var(--color-clay-500)" },
|
|
97
|
+
{ label: "Moss", value: "#4e4d29", swatch: "var(--color-moss-500)" },
|
|
98
|
+
{ label: "Stone", value: "#5c5648", swatch: "var(--color-stone-600)" },
|
|
99
|
+
{ label: "Ink", value: "#1f1c18", swatch: "var(--color-stone-900)" }
|
|
424
100
|
];
|
|
425
101
|
var BLOCK_OPTIONS = [
|
|
426
102
|
{ value: "paragraph", label: "Normal" },
|
|
@@ -448,7 +124,7 @@ function ToolbarButton({
|
|
|
448
124
|
onClick,
|
|
449
125
|
children
|
|
450
126
|
}) {
|
|
451
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ jsx(
|
|
452
128
|
"button",
|
|
453
129
|
{
|
|
454
130
|
type: "button",
|
|
@@ -464,7 +140,7 @@ function ToolbarButton({
|
|
|
464
140
|
);
|
|
465
141
|
}
|
|
466
142
|
function ToolbarDivider({ tokens }) {
|
|
467
|
-
return /* @__PURE__ */
|
|
143
|
+
return /* @__PURE__ */ jsx(
|
|
468
144
|
"span",
|
|
469
145
|
{
|
|
470
146
|
"aria-hidden": "true",
|
|
@@ -479,28 +155,39 @@ function BlockControl({
|
|
|
479
155
|
onChange
|
|
480
156
|
}) {
|
|
481
157
|
const current = BLOCK_OPTIONS.find((option) => option.value === value);
|
|
482
|
-
return /* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
158
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
159
|
+
/* @__PURE__ */ jsxs(
|
|
484
160
|
DropdownMenuTrigger,
|
|
485
161
|
{
|
|
486
162
|
disabled,
|
|
487
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
488
163
|
className: cn(
|
|
489
164
|
toolbarControlClass(tokens),
|
|
490
165
|
"w-auto justify-between gap-1 px-2"
|
|
491
166
|
),
|
|
492
167
|
children: [
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
168
|
+
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: current?.label ?? "Normal" }),
|
|
169
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 opacity-70" })
|
|
495
170
|
]
|
|
496
171
|
}
|
|
497
172
|
),
|
|
498
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { className: "min-w-40", children: /* @__PURE__ */ jsx(
|
|
499
174
|
DropdownMenuRadioGroup,
|
|
500
175
|
{
|
|
501
176
|
value,
|
|
502
177
|
onValueChange: (next) => onChange(next),
|
|
503
|
-
children: BLOCK_OPTIONS.map((option) =>
|
|
178
|
+
children: BLOCK_OPTIONS.map((option) => (
|
|
179
|
+
// closeOnClick: radio items keep the menu open by default, which
|
|
180
|
+
// leaves the popup backdrop blocking the toolbar after a pick.
|
|
181
|
+
/* @__PURE__ */ jsx(
|
|
182
|
+
DropdownMenuRadioItem,
|
|
183
|
+
{
|
|
184
|
+
value: option.value,
|
|
185
|
+
closeOnClick: true,
|
|
186
|
+
children: option.label
|
|
187
|
+
},
|
|
188
|
+
option.value
|
|
189
|
+
)
|
|
190
|
+
))
|
|
504
191
|
}
|
|
505
192
|
) })
|
|
506
193
|
] });
|
|
@@ -513,8 +200,8 @@ function ColorControl({
|
|
|
513
200
|
}) {
|
|
514
201
|
const [open, setOpen] = React.useState(false);
|
|
515
202
|
const active = value !== "";
|
|
516
|
-
return /* @__PURE__ */
|
|
517
|
-
/* @__PURE__ */
|
|
203
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
204
|
+
/* @__PURE__ */ jsx(
|
|
518
205
|
PopoverTrigger,
|
|
519
206
|
{
|
|
520
207
|
disabled,
|
|
@@ -522,9 +209,9 @@ function ColorControl({
|
|
|
522
209
|
title: "Text colour",
|
|
523
210
|
onMouseDown: (event) => event.preventDefault(),
|
|
524
211
|
className: toolbarControlClass(tokens, false),
|
|
525
|
-
children: /* @__PURE__ */
|
|
526
|
-
/* @__PURE__ */
|
|
527
|
-
/* @__PURE__ */
|
|
212
|
+
children: /* @__PURE__ */ jsxs("span", { className: "relative inline-flex flex-col items-center", children: [
|
|
213
|
+
/* @__PURE__ */ jsx(Baseline, { className: active ? "text-fg-brand" : void 0 }),
|
|
214
|
+
/* @__PURE__ */ jsx(
|
|
528
215
|
"span",
|
|
529
216
|
{
|
|
530
217
|
"aria-hidden": "true",
|
|
@@ -535,16 +222,16 @@ function ColorControl({
|
|
|
535
222
|
] })
|
|
536
223
|
}
|
|
537
224
|
),
|
|
538
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
539
226
|
PopoverContent,
|
|
540
227
|
{
|
|
541
228
|
showArrow: false,
|
|
542
229
|
align: "start",
|
|
543
230
|
sideOffset: 8,
|
|
544
231
|
className: "w-auto py-3",
|
|
545
|
-
children: /* @__PURE__ */
|
|
232
|
+
children: /* @__PURE__ */ jsx("div", { className: "grid grid-cols-4 gap-2 px-4", children: TEXT_COLORS.map((color) => {
|
|
546
233
|
const isSelected = color.value === value;
|
|
547
|
-
return /* @__PURE__ */
|
|
234
|
+
return /* @__PURE__ */ jsx(
|
|
548
235
|
"button",
|
|
549
236
|
{
|
|
550
237
|
type: "button",
|
|
@@ -560,14 +247,17 @@ function ColorControl({
|
|
|
560
247
|
"hover:border-line-strong focus-visible:ring-2 focus-visible:ring-line-focus",
|
|
561
248
|
isSelected ? "border-line-focus ring-2 ring-line-focus/40" : "border-line"
|
|
562
249
|
),
|
|
563
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ jsx(
|
|
564
251
|
"span",
|
|
565
252
|
{
|
|
566
253
|
className: cn(
|
|
567
254
|
"flex size-5 items-center justify-center rounded-full text-gdt-xs font-bold",
|
|
568
255
|
color.value === "" && "text-fg-secondary"
|
|
569
256
|
),
|
|
570
|
-
style: color.value ? {
|
|
257
|
+
style: color.value ? {
|
|
258
|
+
backgroundColor: color.swatch,
|
|
259
|
+
color: "var(--color-stone-0, #fff)"
|
|
260
|
+
} : void 0,
|
|
571
261
|
children: "A"
|
|
572
262
|
}
|
|
573
263
|
)
|
|
@@ -600,8 +290,8 @@ function LinkControl({
|
|
|
600
290
|
else onRemove();
|
|
601
291
|
setOpen(false);
|
|
602
292
|
}
|
|
603
|
-
return /* @__PURE__ */
|
|
604
|
-
/* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
294
|
+
/* @__PURE__ */ jsx(
|
|
605
295
|
PopoverTrigger,
|
|
606
296
|
{
|
|
607
297
|
disabled,
|
|
@@ -610,11 +300,11 @@ function LinkControl({
|
|
|
610
300
|
"aria-pressed": active,
|
|
611
301
|
onMouseDown: (event) => event.preventDefault(),
|
|
612
302
|
className: toolbarControlClass(tokens, active),
|
|
613
|
-
children: /* @__PURE__ */
|
|
303
|
+
children: /* @__PURE__ */ jsx(Link2, {})
|
|
614
304
|
}
|
|
615
305
|
),
|
|
616
|
-
/* @__PURE__ */
|
|
617
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ jsx(PopoverContent, { showArrow: false, align: "start", sideOffset: 8, children: /* @__PURE__ */ jsxs("form", { className: "flex flex-col gap-3 px-4", onSubmit: handleSubmit, children: [
|
|
307
|
+
/* @__PURE__ */ jsx(
|
|
618
308
|
Input,
|
|
619
309
|
{
|
|
620
310
|
autoFocus: true,
|
|
@@ -625,8 +315,8 @@ function LinkControl({
|
|
|
625
315
|
onChange: (event) => setHref(event.target.value)
|
|
626
316
|
}
|
|
627
317
|
),
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
319
|
+
/* @__PURE__ */ jsx(
|
|
630
320
|
Button,
|
|
631
321
|
{
|
|
632
322
|
type: "button",
|
|
@@ -640,11 +330,56 @@ function LinkControl({
|
|
|
640
330
|
children: "Remove"
|
|
641
331
|
}
|
|
642
332
|
),
|
|
643
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", size: "sm", children: "Apply" })
|
|
644
334
|
] })
|
|
645
335
|
] }) })
|
|
646
336
|
] });
|
|
647
337
|
}
|
|
338
|
+
function ImageControl({
|
|
339
|
+
tokens,
|
|
340
|
+
disabled,
|
|
341
|
+
onInsert
|
|
342
|
+
}) {
|
|
343
|
+
const [open, setOpen] = React.useState(false);
|
|
344
|
+
const [src, setSrc] = React.useState("");
|
|
345
|
+
function handleOpenChange(next) {
|
|
346
|
+
if (next) setSrc("");
|
|
347
|
+
setOpen(next);
|
|
348
|
+
}
|
|
349
|
+
function handleSubmit(event) {
|
|
350
|
+
event.preventDefault();
|
|
351
|
+
const trimmed = src.trim();
|
|
352
|
+
if (trimmed) onInsert(trimmed);
|
|
353
|
+
setOpen(false);
|
|
354
|
+
}
|
|
355
|
+
return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
|
|
356
|
+
/* @__PURE__ */ jsx(
|
|
357
|
+
PopoverTrigger,
|
|
358
|
+
{
|
|
359
|
+
disabled,
|
|
360
|
+
"aria-label": "Insert image",
|
|
361
|
+
title: "Insert image",
|
|
362
|
+
onMouseDown: (event) => event.preventDefault(),
|
|
363
|
+
className: toolbarControlClass(tokens, false),
|
|
364
|
+
children: /* @__PURE__ */ jsx(ImageIcon, {})
|
|
365
|
+
}
|
|
366
|
+
),
|
|
367
|
+
/* @__PURE__ */ jsx(PopoverContent, { showArrow: false, align: "start", sideOffset: 8, children: /* @__PURE__ */ jsxs("form", { className: "flex flex-col gap-3 px-4", onSubmit: handleSubmit, children: [
|
|
368
|
+
/* @__PURE__ */ jsx(
|
|
369
|
+
Input,
|
|
370
|
+
{
|
|
371
|
+
autoFocus: true,
|
|
372
|
+
size: "sm",
|
|
373
|
+
type: "url",
|
|
374
|
+
placeholder: "https://example.com/image.jpg",
|
|
375
|
+
value: src,
|
|
376
|
+
onChange: (event) => setSrc(event.target.value)
|
|
377
|
+
}
|
|
378
|
+
),
|
|
379
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx(Button, { type: "submit", size: "sm", disabled: !src.trim(), children: "Insert" }) })
|
|
380
|
+
] }) })
|
|
381
|
+
] });
|
|
382
|
+
}
|
|
648
383
|
var ALIGN_OPTIONS = [
|
|
649
384
|
{ value: "left", label: "Left", Icon: AlignLeft },
|
|
650
385
|
{ value: "center", label: "Center", Icon: AlignCenter },
|
|
@@ -659,28 +394,35 @@ function AlignControl({
|
|
|
659
394
|
}) {
|
|
660
395
|
const current = ALIGN_OPTIONS.find((option) => option.value === value);
|
|
661
396
|
const Icon = current?.Icon ?? AlignLeft;
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
397
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
398
|
+
/* @__PURE__ */ jsx(
|
|
664
399
|
DropdownMenuTrigger,
|
|
665
400
|
{
|
|
666
401
|
disabled,
|
|
667
402
|
"aria-label": "Text alignment",
|
|
668
403
|
title: "Text alignment",
|
|
669
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
670
404
|
className: toolbarControlClass(tokens, value !== "left"),
|
|
671
|
-
children: /* @__PURE__ */
|
|
405
|
+
children: /* @__PURE__ */ jsx(Icon, {})
|
|
672
406
|
}
|
|
673
407
|
),
|
|
674
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { className: "min-w-36", children: /* @__PURE__ */ jsx(
|
|
675
409
|
DropdownMenuRadioGroup,
|
|
676
410
|
{
|
|
677
411
|
value,
|
|
678
412
|
onValueChange: (next) => onChange(next),
|
|
679
413
|
children: ALIGN_OPTIONS.map(
|
|
680
|
-
({ value: optionValue, label, Icon: OptionIcon }) => /* @__PURE__ */
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
414
|
+
({ value: optionValue, label, Icon: OptionIcon }) => /* @__PURE__ */ jsxs(
|
|
415
|
+
DropdownMenuRadioItem,
|
|
416
|
+
{
|
|
417
|
+
value: optionValue,
|
|
418
|
+
closeOnClick: true,
|
|
419
|
+
children: [
|
|
420
|
+
/* @__PURE__ */ jsx(OptionIcon, {}),
|
|
421
|
+
label
|
|
422
|
+
]
|
|
423
|
+
},
|
|
424
|
+
optionValue
|
|
425
|
+
)
|
|
684
426
|
)
|
|
685
427
|
}
|
|
686
428
|
) })
|
|
@@ -798,11 +540,10 @@ function RichTextEditor({
|
|
|
798
540
|
function removeLink() {
|
|
799
541
|
editor?.chain().focus().extendMarkRange("link").unsetLink().run();
|
|
800
542
|
}
|
|
801
|
-
function insertImage() {
|
|
802
|
-
|
|
803
|
-
if (url) editor?.chain().focus().setImage({ src: url }).run();
|
|
543
|
+
function insertImage(src) {
|
|
544
|
+
editor?.chain().focus().setImage({ src }).run();
|
|
804
545
|
}
|
|
805
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ jsxs(
|
|
806
547
|
"div",
|
|
807
548
|
{
|
|
808
549
|
"data-slot": "rich-text-editor",
|
|
@@ -815,7 +556,7 @@ function RichTextEditor({
|
|
|
815
556
|
className
|
|
816
557
|
),
|
|
817
558
|
children: [
|
|
818
|
-
/* @__PURE__ */
|
|
559
|
+
/* @__PURE__ */ jsxs(
|
|
819
560
|
"div",
|
|
820
561
|
{
|
|
821
562
|
role: "toolbar",
|
|
@@ -827,7 +568,7 @@ function RichTextEditor({
|
|
|
827
568
|
tokens.toolbarGap
|
|
828
569
|
),
|
|
829
570
|
children: [
|
|
830
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ jsx(
|
|
831
572
|
BlockControl,
|
|
832
573
|
{
|
|
833
574
|
tokens,
|
|
@@ -836,7 +577,7 @@ function RichTextEditor({
|
|
|
836
577
|
onChange: setBlock
|
|
837
578
|
}
|
|
838
579
|
),
|
|
839
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ jsx(
|
|
840
581
|
ToolbarButton,
|
|
841
582
|
{
|
|
842
583
|
tokens,
|
|
@@ -844,10 +585,10 @@ function RichTextEditor({
|
|
|
844
585
|
active: s.isBold,
|
|
845
586
|
disabled,
|
|
846
587
|
onClick: () => editor?.chain().focus().toggleBold().run(),
|
|
847
|
-
children: /* @__PURE__ */
|
|
588
|
+
children: /* @__PURE__ */ jsx(Bold, {})
|
|
848
589
|
}
|
|
849
590
|
),
|
|
850
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ jsx(
|
|
851
592
|
ToolbarButton,
|
|
852
593
|
{
|
|
853
594
|
tokens,
|
|
@@ -855,10 +596,10 @@ function RichTextEditor({
|
|
|
855
596
|
active: s.isItalic,
|
|
856
597
|
disabled,
|
|
857
598
|
onClick: () => editor?.chain().focus().toggleItalic().run(),
|
|
858
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ jsx(Italic, {})
|
|
859
600
|
}
|
|
860
601
|
),
|
|
861
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ jsx(
|
|
862
603
|
ToolbarButton,
|
|
863
604
|
{
|
|
864
605
|
tokens,
|
|
@@ -866,10 +607,10 @@ function RichTextEditor({
|
|
|
866
607
|
active: s.isUnderline,
|
|
867
608
|
disabled,
|
|
868
609
|
onClick: () => editor?.chain().focus().toggleUnderline().run(),
|
|
869
|
-
children: /* @__PURE__ */
|
|
610
|
+
children: /* @__PURE__ */ jsx(Underline, {})
|
|
870
611
|
}
|
|
871
612
|
),
|
|
872
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ jsx(
|
|
873
614
|
ColorControl,
|
|
874
615
|
{
|
|
875
616
|
tokens,
|
|
@@ -878,8 +619,8 @@ function RichTextEditor({
|
|
|
878
619
|
onChange: setColor
|
|
879
620
|
}
|
|
880
621
|
),
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ jsx(ToolbarDivider, { tokens }),
|
|
623
|
+
/* @__PURE__ */ jsx(
|
|
883
624
|
ToolbarButton,
|
|
884
625
|
{
|
|
885
626
|
tokens,
|
|
@@ -887,10 +628,10 @@ function RichTextEditor({
|
|
|
887
628
|
active: s.isOrderedList,
|
|
888
629
|
disabled,
|
|
889
630
|
onClick: () => editor?.chain().focus().toggleOrderedList().run(),
|
|
890
|
-
children: /* @__PURE__ */
|
|
631
|
+
children: /* @__PURE__ */ jsx(ListOrdered, {})
|
|
891
632
|
}
|
|
892
633
|
),
|
|
893
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ jsx(
|
|
894
635
|
ToolbarButton,
|
|
895
636
|
{
|
|
896
637
|
tokens,
|
|
@@ -898,10 +639,10 @@ function RichTextEditor({
|
|
|
898
639
|
active: s.isBulletList,
|
|
899
640
|
disabled,
|
|
900
641
|
onClick: () => editor?.chain().focus().toggleBulletList().run(),
|
|
901
|
-
children: /* @__PURE__ */
|
|
642
|
+
children: /* @__PURE__ */ jsx(List, {})
|
|
902
643
|
}
|
|
903
644
|
),
|
|
904
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ jsx(
|
|
905
646
|
AlignControl,
|
|
906
647
|
{
|
|
907
648
|
tokens,
|
|
@@ -910,8 +651,8 @@ function RichTextEditor({
|
|
|
910
651
|
onChange: setAlign
|
|
911
652
|
}
|
|
912
653
|
),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ jsx(ToolbarDivider, { tokens }),
|
|
655
|
+
/* @__PURE__ */ jsx(
|
|
915
656
|
LinkControl,
|
|
916
657
|
{
|
|
917
658
|
tokens,
|
|
@@ -922,7 +663,7 @@ function RichTextEditor({
|
|
|
922
663
|
onRemove: removeLink
|
|
923
664
|
}
|
|
924
665
|
),
|
|
925
|
-
/* @__PURE__ */
|
|
666
|
+
/* @__PURE__ */ jsx(
|
|
926
667
|
ToolbarButton,
|
|
927
668
|
{
|
|
928
669
|
tokens,
|
|
@@ -930,10 +671,10 @@ function RichTextEditor({
|
|
|
930
671
|
active: s.isBlockquote,
|
|
931
672
|
disabled,
|
|
932
673
|
onClick: () => editor?.chain().focus().toggleBlockquote().run(),
|
|
933
|
-
children: /* @__PURE__ */
|
|
674
|
+
children: /* @__PURE__ */ jsx(Quote, {})
|
|
934
675
|
}
|
|
935
676
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ jsx(
|
|
937
678
|
ToolbarButton,
|
|
938
679
|
{
|
|
939
680
|
tokens,
|
|
@@ -941,45 +682,43 @@ function RichTextEditor({
|
|
|
941
682
|
active: s.isCodeBlock,
|
|
942
683
|
disabled,
|
|
943
684
|
onClick: () => editor?.chain().focus().toggleCodeBlock().run(),
|
|
944
|
-
children: /* @__PURE__ */
|
|
685
|
+
children: /* @__PURE__ */ jsx(Code2, {})
|
|
945
686
|
}
|
|
946
687
|
),
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
|
|
688
|
+
/* @__PURE__ */ jsx(
|
|
689
|
+
ImageControl,
|
|
949
690
|
{
|
|
950
691
|
tokens,
|
|
951
|
-
label: "Insert image",
|
|
952
692
|
disabled,
|
|
953
|
-
|
|
954
|
-
children: /* @__PURE__ */ jsx7(ImageIcon, {})
|
|
693
|
+
onInsert: insertImage
|
|
955
694
|
}
|
|
956
695
|
),
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
696
|
+
/* @__PURE__ */ jsx(ToolbarDivider, { tokens }),
|
|
697
|
+
/* @__PURE__ */ jsx(
|
|
959
698
|
ToolbarButton,
|
|
960
699
|
{
|
|
961
700
|
tokens,
|
|
962
701
|
label: "Undo",
|
|
963
702
|
disabled: disabled || !s.canUndo,
|
|
964
703
|
onClick: () => editor?.chain().focus().undo().run(),
|
|
965
|
-
children: /* @__PURE__ */
|
|
704
|
+
children: /* @__PURE__ */ jsx(Undo2, {})
|
|
966
705
|
}
|
|
967
706
|
),
|
|
968
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ jsx(
|
|
969
708
|
ToolbarButton,
|
|
970
709
|
{
|
|
971
710
|
tokens,
|
|
972
711
|
label: "Redo",
|
|
973
712
|
disabled: disabled || !s.canRedo,
|
|
974
713
|
onClick: () => editor?.chain().focus().redo().run(),
|
|
975
|
-
children: /* @__PURE__ */
|
|
714
|
+
children: /* @__PURE__ */ jsx(Redo2, {})
|
|
976
715
|
}
|
|
977
716
|
)
|
|
978
717
|
]
|
|
979
718
|
}
|
|
980
719
|
),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ jsx("div", { className: "h-px w-full shrink-0 bg-line-subtle" }),
|
|
721
|
+
/* @__PURE__ */ jsx(
|
|
983
722
|
EditorContent,
|
|
984
723
|
{
|
|
985
724
|
editor,
|