@stoa-dev/kit 1.0.3 → 1.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/CHANGELOG.md +9 -1
- package/dist/display/BarChart/index.js +147 -31
- package/dist/display/BarChart/index.js.map +1 -1
- package/dist/i18n/locales/at.json.js +16 -14
- package/dist/i18n/locales/at.json.js.map +1 -1
- package/dist/i18n/locales/de.json.js +16 -14
- package/dist/i18n/locales/de.json.js.map +1 -1
- package/dist/i18n/locales/en.json.js +12 -10
- package/dist/i18n/locales/en.json.js.map +1 -1
- package/dist/i18n/locales/it.json.js +16 -14
- package/dist/i18n/locales/it.json.js.map +1 -1
- package/dist/kit.css +1 -1
- package/dist/types/display/BarChart/index.d.ts +26 -2
- package/dist/types/display/BarChart/index.d.ts.map +1 -1
- package/dist/types/i18n/index.d.ts +56 -0
- package/dist/types/i18n/index.d.ts.map +1 -1
- package/dist/types/ui/color-picker/color.d.ts +13 -0
- package/dist/types/ui/color-picker/color.d.ts.map +1 -0
- package/dist/types/ui/color-picker/index.d.ts +10 -0
- package/dist/types/ui/color-picker/index.d.ts.map +1 -0
- package/dist/types/ui/color-picker-toggle/index.d.ts +8 -0
- package/dist/types/ui/color-picker-toggle/index.d.ts.map +1 -0
- package/dist/types/ui/index.d.ts +2 -0
- package/dist/types/ui/index.d.ts.map +1 -1
- package/dist/ui/color-picker/ColorPicker.module.scss.js +42 -0
- package/dist/ui/color-picker/ColorPicker.module.scss.js.map +1 -0
- package/dist/ui/color-picker/color.js +60 -0
- package/dist/ui/color-picker/color.js.map +1 -0
- package/dist/ui/color-picker/index.js +239 -0
- package/dist/ui/color-picker/index.js.map +1 -0
- package/dist/ui/color-picker-toggle/index.js +66 -0
- package/dist/ui/color-picker-toggle/index.js.map +1 -0
- package/dist/ui/index.js +105 -101
- package/dist/ui/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsxs as n, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h } from "react";
|
|
3
|
+
import { useTranslation as v } from "react-i18next";
|
|
4
|
+
import { STOA_NS as C } from "../../i18n/namespace.js";
|
|
5
|
+
import { Button as g } from "../button/index.js";
|
|
6
|
+
import { ColorPicker as b } from "../color-picker/index.js";
|
|
7
|
+
import { DEFAULT_COLOR as a, normalizeColor as l } from "../color-picker/color.js";
|
|
8
|
+
import { Popover as P, PopoverTrigger as x, PopoverContent as k } from "../popover/index.js";
|
|
9
|
+
function A({
|
|
10
|
+
value: e,
|
|
11
|
+
defaultValue: s,
|
|
12
|
+
onChange: c,
|
|
13
|
+
className: m,
|
|
14
|
+
label: d,
|
|
15
|
+
disabled: p
|
|
16
|
+
}) {
|
|
17
|
+
const { t } = v(C), [f, u] = h(
|
|
18
|
+
() => l(s ?? "") ?? a
|
|
19
|
+
), r = e === void 0 ? f : l(e) ?? a;
|
|
20
|
+
return /* @__PURE__ */ n(P, { children: [
|
|
21
|
+
/* @__PURE__ */ o(x, { asChild: !0, children: /* @__PURE__ */ n(
|
|
22
|
+
g,
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
variant: "outline",
|
|
26
|
+
disabled: p,
|
|
27
|
+
className: m,
|
|
28
|
+
"aria-label": `${d ?? t("colorPicker.choose", "Choose color")}: ${r}`,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ o(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
"aria-hidden": "true",
|
|
34
|
+
className: "size-5 rounded-full border border-current/25",
|
|
35
|
+
style: { backgroundColor: r }
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ o("span", { className: "font-mono", children: r })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
) }),
|
|
42
|
+
/* @__PURE__ */ o(
|
|
43
|
+
k,
|
|
44
|
+
{
|
|
45
|
+
align: "start",
|
|
46
|
+
sideOffset: 8,
|
|
47
|
+
collisionPadding: 12,
|
|
48
|
+
"aria-label": t("colorPicker.title", "Color instrument"),
|
|
49
|
+
className: "max-h-(--radix-popover-content-available-height) w-[27.5rem] max-w-(--radix-popover-content-available-width) overflow-y-auto overscroll-contain rounded-[1.375rem] p-0",
|
|
50
|
+
children: /* @__PURE__ */ o(
|
|
51
|
+
b,
|
|
52
|
+
{
|
|
53
|
+
value: r,
|
|
54
|
+
onChange: (i) => {
|
|
55
|
+
e === void 0 && u(i), c?.(i);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
)
|
|
61
|
+
] });
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
A as ColorPickerToggle
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/ui/color-picker-toggle/index.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\nimport { useTranslation } from 'react-i18next'\nimport { STOA_NS } from '../../i18n/namespace'\nimport { Button } from '../button'\nimport { ColorPicker, type ColorPickerProps } from '../color-picker'\nimport { DEFAULT_COLOR, normalizeColor } from '../color-picker/color'\nimport { Popover, PopoverContent, PopoverTrigger } from '../popover'\n\nexport interface ColorPickerToggleProps extends ColorPickerProps {\n\t/** Accessible name for the trigger. */\n\tlabel?: string\n\tdisabled?: boolean\n}\n\nexport function ColorPickerToggle({\n\tvalue,\n\tdefaultValue,\n\tonChange,\n\tclassName,\n\tlabel,\n\tdisabled,\n}: ColorPickerToggleProps) {\n\tconst { t } = useTranslation(STOA_NS)\n\tconst [internal, setInternal] = useState(\n\t\t() => normalizeColor(defaultValue ?? '') ?? DEFAULT_COLOR,\n\t)\n\tconst color =\n\t\tvalue === undefined ? internal : (normalizeColor(value) ?? DEFAULT_COLOR)\n\n\treturn (\n\t\t<Popover>\n\t\t\t<PopoverTrigger asChild>\n\t\t\t\t<Button\n\t\t\t\t\ttype='button'\n\t\t\t\t\tvariant='outline'\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\taria-label={`${label ?? t('colorPicker.choose', 'Choose color')}: ${color}`}\n\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\taria-hidden='true'\n\t\t\t\t\t\tclassName='size-5 rounded-full border border-current/25'\n\t\t\t\t\t\tstyle={{ backgroundColor: color }}\n\t\t\t\t\t/>\n\t\t\t\t\t<span className='font-mono'>{color}</span>\n\t\t\t\t</Button>\n\t\t\t</PopoverTrigger>\n\t\t\t<PopoverContent\n\t\t\t\talign='start'\n\t\t\t\tsideOffset={8}\n\t\t\t\tcollisionPadding={12}\n\t\t\t\taria-label={t('colorPicker.title', 'Color instrument')}\n\t\t\t\tclassName='max-h-(--radix-popover-content-available-height) w-[27.5rem] max-w-(--radix-popover-content-available-width) overflow-y-auto overscroll-contain rounded-[1.375rem] p-0'\n\t\t\t>\n\t\t\t\t<ColorPicker\n\t\t\t\t\tvalue={color}\n\t\t\t\t\tonChange={(next) => {\n\t\t\t\t\t\tif (value === undefined) setInternal(next)\n\t\t\t\t\t\tonChange?.(next)\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t</PopoverContent>\n\t\t</Popover>\n\t)\n}\n"],"names":["ColorPickerToggle","value","defaultValue","onChange","className","label","disabled","useTranslation","STOA_NS","internal","setInternal","useState","normalizeColor","DEFAULT_COLOR","color","Popover","jsx","PopoverTrigger","jsxs","Button","PopoverContent","ColorPicker","next"],"mappings":";;;;;;;;AAgBO,SAASA,EAAkB;AAAA,EACjC,OAAAC;AAAA,EACA,cAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,UAAAC;AACD,GAA2B;AAC1B,QAAM,EAAE,EAAA,IAAMC,EAAeC,CAAO,GAC9B,CAACC,GAAUC,CAAW,IAAIC;AAAA,IAC/B,MAAMC,EAAeV,KAAgB,EAAE,KAAKW;AAAA,EAAA,GAEvCC,IACLb,MAAU,SAAYQ,IAAYG,EAAeX,CAAK,KAAKY;AAE5D,2BACEE,GAAA,EACA,UAAA;AAAA,IAAA,gBAAAC,EAACC,GAAA,EAAe,SAAO,IACtB,UAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACA,MAAK;AAAA,QACL,SAAQ;AAAA,QACR,UAAAb;AAAA,QACA,WAAAF;AAAA,QACA,cAAY,GAAGC,KAAS,EAAE,sBAAsB,cAAc,CAAC,KAAKS,CAAK;AAAA,QAEzE,UAAA;AAAA,UAAA,gBAAAE;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,eAAY;AAAA,cACZ,WAAU;AAAA,cACV,OAAO,EAAE,iBAAiBF,EAAA;AAAA,YAAM;AAAA,UAAA;AAAA,UAEjC,gBAAAE,EAAC,QAAA,EAAK,WAAU,aAAa,UAAAF,EAAA,CAAM;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,GAErC;AAAA,IACA,gBAAAE;AAAA,MAACI;AAAA,MAAA;AAAA,QACA,OAAM;AAAA,QACN,YAAY;AAAA,QACZ,kBAAkB;AAAA,QAClB,cAAY,EAAE,qBAAqB,kBAAkB;AAAA,QACrD,WAAU;AAAA,QAEV,UAAA,gBAAAJ;AAAA,UAACK;AAAA,UAAA;AAAA,YACA,OAAOP;AAAA,YACP,UAAU,CAACQ,MAAS;AACnB,cAAIrB,MAAU,UAAWS,EAAYY,CAAI,GACzCnB,IAAWmB,CAAI;AAAA,YAChB;AAAA,UAAA;AAAA,QAAA;AAAA,MACD;AAAA,IAAA;AAAA,EACD,GACD;AAEF;"}
|
package/dist/ui/index.js
CHANGED
|
@@ -1,116 +1,120 @@
|
|
|
1
|
-
import { Accordion as
|
|
1
|
+
import { Accordion as e, AccordionContent as t, AccordionItem as n, AccordionTrigger as p } from "./accordion/index.js";
|
|
2
2
|
import { Button as i, buttonVariants as a } from "./button/index.js";
|
|
3
3
|
import { Calendar as u, CalendarDayButton as c } from "./calendar/index.js";
|
|
4
|
-
import { Card as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
4
|
+
import { Card as m, CardAction as D, CardContent as x, CardDescription as S, CardFooter as f, CardHeader as T, CardTitle as C } from "./card/index.js";
|
|
5
|
+
import { ColorPicker as M } from "./color-picker/index.js";
|
|
6
|
+
import { ColorPickerToggle as F } from "./color-picker-toggle/index.js";
|
|
7
|
+
import { Dialog as P, DialogClose as b, DialogContent as v, DialogDescription as s, DialogFooter as A, DialogHeader as h, DialogOverlay as B, DialogPortal as L, DialogTitle as R, DialogTrigger as k } from "./dialog/index.js";
|
|
8
|
+
import { DropdownMenu as V, DropdownMenuCheckboxItem as y, DropdownMenuContent as E, DropdownMenuGroup as O, DropdownMenuItem as U, DropdownMenuLabel as j, DropdownMenuPortal as q, DropdownMenuRadioGroup as z, DropdownMenuRadioItem as J, DropdownMenuSeparator as K, DropdownMenuShortcut as N, DropdownMenuSub as Q, DropdownMenuSubContent as W, DropdownMenuSubTrigger as X, DropdownMenuTrigger as Y } from "./dropdown-menu/index.js";
|
|
9
|
+
import { Field as _, FieldContent as $, FieldDescription as oo, FieldError as ro, FieldGroup as eo, FieldLabel as to, FieldLegend as no, FieldSeparator as po, FieldSet as lo, FieldTitle as io } from "./field/index.js";
|
|
10
|
+
import { Input as uo } from "./input/index.js";
|
|
11
|
+
import { InputGroup as go, InputGroupAddon as mo, InputGroupButton as Do, InputGroupInput as xo, InputGroupText as So, InputGroupTextarea as fo } from "./input-group/index.js";
|
|
12
|
+
import { Label as Co } from "./label/index.js";
|
|
13
|
+
import { Popover as Mo, PopoverAnchor as Io, PopoverContent as Fo, PopoverDescription as Go, PopoverHeader as Po, PopoverTitle as bo, PopoverTrigger as vo } from "./popover/index.js";
|
|
14
|
+
import { RadioGroup as Ao, RadioGroupItem as ho } from "./radio-group/index.js";
|
|
15
|
+
import { ScrollArea as Lo, ScrollBar as Ro } from "./scroll-area/index.js";
|
|
16
|
+
import { Select as Ho, SelectContent as Vo, SelectGroup as yo, SelectItem as Eo, SelectLabel as Oo, SelectScrollDownButton as Uo, SelectScrollUpButton as jo, SelectSeparator as qo, SelectTrigger as zo, SelectValue as Jo } from "./select/index.js";
|
|
17
|
+
import { Separator as No } from "./separator/index.js";
|
|
18
|
+
import { Toaster as Wo } from "./sonner/index.js";
|
|
19
|
+
import { Switch as Yo } from "./switch/index.js";
|
|
20
|
+
import { Textarea as _o } from "./textarea/index.js";
|
|
21
|
+
import { ThemeSwitch as or } from "./theme-switch/index.js";
|
|
22
|
+
import { ThemeToggle as er } from "./theme-toggle/index.js";
|
|
23
|
+
import { Toggle as nr, toggleVariants as pr } from "./toggle/index.js";
|
|
24
|
+
import { Tooltip as ir, TooltipContent as ar, TooltipProvider as dr, TooltipTrigger as ur } from "./tooltip/index.js";
|
|
23
25
|
export {
|
|
24
|
-
|
|
26
|
+
e as Accordion,
|
|
25
27
|
t as AccordionContent,
|
|
26
28
|
n as AccordionItem,
|
|
27
29
|
p as AccordionTrigger,
|
|
28
30
|
i as Button,
|
|
29
31
|
u as Calendar,
|
|
30
32
|
c as CalendarDayButton,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
m as Card,
|
|
34
|
+
D as CardAction,
|
|
33
35
|
x as CardContent,
|
|
34
36
|
S as CardDescription,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
f as CardFooter,
|
|
38
|
+
T as CardHeader,
|
|
37
39
|
C as CardTitle,
|
|
38
|
-
M as
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
io as
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Yo as
|
|
106
|
-
_o as
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
40
|
+
M as ColorPicker,
|
|
41
|
+
F as ColorPickerToggle,
|
|
42
|
+
P as Dialog,
|
|
43
|
+
b as DialogClose,
|
|
44
|
+
v as DialogContent,
|
|
45
|
+
s as DialogDescription,
|
|
46
|
+
A as DialogFooter,
|
|
47
|
+
h as DialogHeader,
|
|
48
|
+
B as DialogOverlay,
|
|
49
|
+
L as DialogPortal,
|
|
50
|
+
R as DialogTitle,
|
|
51
|
+
k as DialogTrigger,
|
|
52
|
+
V as DropdownMenu,
|
|
53
|
+
y as DropdownMenuCheckboxItem,
|
|
54
|
+
E as DropdownMenuContent,
|
|
55
|
+
O as DropdownMenuGroup,
|
|
56
|
+
U as DropdownMenuItem,
|
|
57
|
+
j as DropdownMenuLabel,
|
|
58
|
+
q as DropdownMenuPortal,
|
|
59
|
+
z as DropdownMenuRadioGroup,
|
|
60
|
+
J as DropdownMenuRadioItem,
|
|
61
|
+
K as DropdownMenuSeparator,
|
|
62
|
+
N as DropdownMenuShortcut,
|
|
63
|
+
Q as DropdownMenuSub,
|
|
64
|
+
W as DropdownMenuSubContent,
|
|
65
|
+
X as DropdownMenuSubTrigger,
|
|
66
|
+
Y as DropdownMenuTrigger,
|
|
67
|
+
_ as Field,
|
|
68
|
+
$ as FieldContent,
|
|
69
|
+
oo as FieldDescription,
|
|
70
|
+
ro as FieldError,
|
|
71
|
+
eo as FieldGroup,
|
|
72
|
+
to as FieldLabel,
|
|
73
|
+
no as FieldLegend,
|
|
74
|
+
po as FieldSeparator,
|
|
75
|
+
lo as FieldSet,
|
|
76
|
+
io as FieldTitle,
|
|
77
|
+
uo as Input,
|
|
78
|
+
go as InputGroup,
|
|
79
|
+
mo as InputGroupAddon,
|
|
80
|
+
Do as InputGroupButton,
|
|
81
|
+
xo as InputGroupInput,
|
|
82
|
+
So as InputGroupText,
|
|
83
|
+
fo as InputGroupTextarea,
|
|
84
|
+
Co as Label,
|
|
85
|
+
Mo as Popover,
|
|
86
|
+
Io as PopoverAnchor,
|
|
87
|
+
Fo as PopoverContent,
|
|
88
|
+
Go as PopoverDescription,
|
|
89
|
+
Po as PopoverHeader,
|
|
90
|
+
bo as PopoverTitle,
|
|
91
|
+
vo as PopoverTrigger,
|
|
92
|
+
Ao as RadioGroup,
|
|
93
|
+
ho as RadioGroupItem,
|
|
94
|
+
Lo as ScrollArea,
|
|
95
|
+
Ro as ScrollBar,
|
|
96
|
+
Ho as Select,
|
|
97
|
+
Vo as SelectContent,
|
|
98
|
+
yo as SelectGroup,
|
|
99
|
+
Eo as SelectItem,
|
|
100
|
+
Oo as SelectLabel,
|
|
101
|
+
Uo as SelectScrollDownButton,
|
|
102
|
+
jo as SelectScrollUpButton,
|
|
103
|
+
qo as SelectSeparator,
|
|
104
|
+
zo as SelectTrigger,
|
|
105
|
+
Jo as SelectValue,
|
|
106
|
+
No as Separator,
|
|
107
|
+
Yo as Switch,
|
|
108
|
+
_o as Textarea,
|
|
109
|
+
or as ThemeSwitch,
|
|
110
|
+
er as ThemeToggle,
|
|
111
|
+
Wo as Toaster,
|
|
112
|
+
nr as Toggle,
|
|
113
|
+
ir as Tooltip,
|
|
114
|
+
ar as TooltipContent,
|
|
115
|
+
dr as TooltipProvider,
|
|
116
|
+
ur as TooltipTrigger,
|
|
113
117
|
a as buttonVariants,
|
|
114
|
-
|
|
118
|
+
pr as toggleVariants
|
|
115
119
|
};
|
|
116
120
|
//# sourceMappingURL=index.js.map
|
package/dist/ui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|