@konstructio/ui 0.1.2-alpha.46 → 0.1.2-alpha.47

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.
@@ -1,30 +1,31 @@
1
1
  import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
- import { useId as N, useState as y, useRef as E, useCallback as O, useEffect as I } from "react";
3
- import { cn as c } from "../../../../utils/index.js";
4
- import { timePickerVariants as L } from "../../TimePicker.variants.js";
2
+ import { useId as N, useState as E, useRef as L, useCallback as O, useEffect as I } from "react";
3
+ import { Typography as c } from "../../../Typography/Typography.js";
4
+ import { cn as d } from "../../../../utils/index.js";
5
+ import { timePickerVariants as T } from "../../TimePicker.variants.js";
5
6
  import { WrapperList as j } from "../WrapperList/WrapperList.js";
6
7
  import { C as P } from "../../../../chevron-down-DgT-uSF9.js";
7
8
  import { useTimePickerContext as R } from "../../contexts/time-picker.hook.js";
8
- const V = ({
9
- name: d,
10
- label: l,
11
- required: p,
12
- scrollBehavior: f,
13
- className: u,
9
+ const q = ({
10
+ name: p,
11
+ label: i,
12
+ isRequired: f,
13
+ scrollBehavior: u,
14
+ className: h,
14
15
  listClassName: x,
15
- listItemClassName: h,
16
- listItemButtonClassName: w
16
+ listItemClassName: w,
17
+ listItemButtonClassName: b
17
18
  }) => {
18
- const b = N(), [n, r] = y(!1), i = E(null), { format: k, formattedTime: m } = R(), s = d ?? `time-${b}`, g = O(() => r((e) => !e), []);
19
+ const g = N(), [n, r] = E(!1), l = L(null), { format: k, formattedTime: m } = R(), o = p ?? `time-${g}`, v = O(() => r((e) => !e), []);
19
20
  return I(() => {
20
- const e = new AbortController(), v = (o) => {
21
- o.key === "Escape" && r(!1);
22
- }, C = (o) => {
23
- i.current?.contains(o.target) || r(!1);
21
+ const e = new AbortController(), y = (s) => {
22
+ s.key === "Escape" && r(!1);
23
+ }, C = (s) => {
24
+ l.current?.contains(s.target) || r(!1);
24
25
  };
25
26
  return document.addEventListener("mousedown", C, {
26
27
  signal: e.signal
27
- }), document.addEventListener("keydown", v, {
28
+ }), document.addEventListener("keydown", y, {
28
29
  signal: e.signal
29
30
  }), () => {
30
31
  e.abort();
@@ -32,21 +33,35 @@ const V = ({
32
33
  }, []), /* @__PURE__ */ t(
33
34
  "div",
34
35
  {
35
- ref: i,
36
- className: c(
37
- "w-max text-slate-800 text-sm flex flex-col gap-2",
38
- k === "12" ? "w-52" : "w-[140px]"
36
+ ref: l,
37
+ className: d(
38
+ "w-max",
39
+ "text-slate-800",
40
+ "text-sm",
41
+ "flex",
42
+ "flex-col",
43
+ "gap-2",
44
+ k === "12" ? "w-53 min-w-53" : "w-36 min-w-36"
39
45
  ),
40
46
  children: [
41
- l ? /* @__PURE__ */ t(
42
- "label",
47
+ i ? /* @__PURE__ */ t(
48
+ c,
43
49
  {
44
- htmlFor: s,
45
- className: "text-slate-500 dark:text-metal-50 font-medium",
50
+ component: "label",
51
+ variant: "labelLarge",
52
+ htmlFor: o,
53
+ className: "font-medium",
46
54
  children: [
47
- l,
55
+ i,
48
56
  " ",
49
- p && /* @__PURE__ */ a("span", { className: "text-red-600", children: "*" })
57
+ f && /* @__PURE__ */ a(
58
+ c,
59
+ {
60
+ component: "span",
61
+ className: "text-red-500 dark:text-red-500 text-sm font-normal",
62
+ children: "*"
63
+ }
64
+ )
50
65
  ]
51
66
  }
52
67
  ) : null,
@@ -54,13 +69,13 @@ const V = ({
54
69
  /* @__PURE__ */ t(
55
70
  "button",
56
71
  {
57
- "aria-label": s,
72
+ "aria-label": o,
58
73
  "aria-haspopup": "listbox",
59
74
  "aria-expanded": "true",
60
75
  "aria-controls": "time-options",
61
- className: c(L({ className: u })),
76
+ className: d(T({ className: h })),
62
77
  "data-open": n,
63
- onClick: g,
78
+ onClick: v,
64
79
  children: [
65
80
  m,
66
81
  /* @__PURE__ */ a(
@@ -77,10 +92,10 @@ const V = ({
77
92
  j,
78
93
  {
79
94
  isOpen: n,
80
- scrollBehavior: f,
95
+ scrollBehavior: u,
81
96
  listClassName: x,
82
- listItemClassName: h,
83
- listItemButtonClassName: w
97
+ listItemClassName: w,
98
+ listItemButtonClassName: b
84
99
  }
85
100
  )
86
101
  ] }),
@@ -88,7 +103,7 @@ const V = ({
88
103
  "input",
89
104
  {
90
105
  type: "hidden",
91
- name: s,
106
+ name: o,
92
107
  value: m,
93
108
  className: "hidden"
94
109
  }
@@ -98,5 +113,5 @@ const V = ({
98
113
  );
99
114
  };
100
115
  export {
101
- V as Wrapper
116
+ q as Wrapper
102
117
  };
@@ -2,27 +2,25 @@ import { jsx as n } from "react/jsx-runtime";
2
2
  import { forwardRef as y } from "react";
3
3
  import { cn as c } from "../../utils/index.js";
4
4
  import { typographyVariants as f } from "./Typography.variants.js";
5
- const d = y(({ className: o, theme: r, children: p, variant: t, component: e, ...m }, a) => {
6
- const s = e ?? (t?.includes("h") ? t : "p");
5
+ const h = y(({ className: r, theme: p, children: t, variant: o, component: m, ...e }, s) => {
6
+ const a = m ?? (o?.includes("h") ? o : "p");
7
7
  return /* @__PURE__ */ n(
8
- s,
8
+ a,
9
9
  {
10
- ref: a,
11
- "data-theme": r,
10
+ ref: s,
11
+ "data-theme": p,
12
12
  className: c(
13
- "text-slate-800",
14
- "dark:text-metal-50",
15
13
  f({
16
- className: o,
17
- variant: t
14
+ className: r,
15
+ variant: o
18
16
  })
19
17
  ),
20
- ...m,
21
- children: p
18
+ ...e,
19
+ children: t
22
20
  }
23
21
  );
24
22
  });
25
- d.displayName = "KonstructTypography";
23
+ h.displayName = "KonstructTypography";
26
24
  export {
27
- d as Typography
25
+ h as Typography
28
26
  };
@@ -1,52 +1,55 @@
1
1
  import { c as t } from "../../index-D29mdTf5.js";
2
- const a = t([], {
3
- variants: {
4
- variant: {
5
- h1: ["text-[57px]", "leading-16"],
6
- h2: ["text-[45px]", "leading-13"],
7
- h3: ["text-4xl", "leading-11"],
8
- h4: ["text-[32px]", "leading-10"],
9
- h5: ["text-[28px]", "leading-9"],
10
- h6: ["text-2xl", "font-medium", "leading-8", "tracking-[0.15px]"],
11
- subtitle1: ["text-[22px]", "leading-7"],
12
- subtitle2: ["text-sm", "font-medium", "leading-6", "tracking-[0.15px]"],
13
- subtitle3: [
14
- "text-[14px]",
15
- "font-medium",
16
- "leading-5",
17
- "tracking-[0.1px]"
18
- ],
19
- labelLarge: ["text-sm", "leading-5", "tracking-[0.1px]"],
20
- labelMedium: [
21
- "text-[12px]",
22
- "font-medium",
23
- "leading-4",
24
- "tracking-[0.5px]",
25
- "uppercase"
26
- ],
27
- labelSmall: [
28
- "text-[11px]",
29
- "font-medium",
30
- "leading-4",
31
- "tracking-[0.5px]",
32
- "uppercase"
33
- ],
34
- buttonSmall: [
35
- "text-[14px]",
36
- "font-semibold",
37
- "leading-5",
38
- "tracking-[0.25px]"
39
- ],
40
- body1: ["text-base", "leading-6", "tracking-[0.5px]"],
41
- body2: ["text-sm", "leading-5", "tracking-[0.25px]"],
42
- body3: ["text-xs", "leading-4", "tracking-[0.4px]"],
43
- tooltip: ["text-sm", "leading-5.5"]
2
+ const a = t(
3
+ ["text-slate-800", "dark:text-metal-50"],
4
+ {
5
+ variants: {
6
+ variant: {
7
+ h1: ["text-[57px]", "leading-16"],
8
+ h2: ["text-[45px]", "leading-13"],
9
+ h3: ["text-4xl", "leading-11"],
10
+ h4: ["text-[32px]", "leading-10"],
11
+ h5: ["text-[28px]", "leading-9"],
12
+ h6: ["text-2xl", "font-medium", "leading-8", "tracking-[0.15px]"],
13
+ subtitle1: ["text-[22px]", "leading-7"],
14
+ subtitle2: ["text-sm", "font-medium", "leading-6", "tracking-[0.15px]"],
15
+ subtitle3: [
16
+ "text-[14px]",
17
+ "font-medium",
18
+ "leading-5",
19
+ "tracking-[0.1px]"
20
+ ],
21
+ labelLarge: ["text-sm", "leading-5", "tracking-[0.1px]"],
22
+ labelMedium: [
23
+ "text-[12px]",
24
+ "font-medium",
25
+ "leading-4",
26
+ "tracking-[0.5px]",
27
+ "uppercase"
28
+ ],
29
+ labelSmall: [
30
+ "text-[11px]",
31
+ "font-medium",
32
+ "leading-4",
33
+ "tracking-[0.5px]",
34
+ "uppercase"
35
+ ],
36
+ buttonSmall: [
37
+ "text-[14px]",
38
+ "font-semibold",
39
+ "leading-5",
40
+ "tracking-[0.25px]"
41
+ ],
42
+ body1: ["text-base", "leading-6", "tracking-[0.5px]"],
43
+ body2: ["text-sm", "leading-5", "tracking-[0.25px]"],
44
+ body3: ["text-xs", "leading-4", "tracking-[0.4px]"],
45
+ tooltip: ["text-sm", "leading-5.5"]
46
+ }
47
+ },
48
+ defaultVariants: {
49
+ variant: "body1"
44
50
  }
45
- },
46
- defaultVariants: {
47
- variant: "body1"
48
51
  }
49
- });
52
+ );
50
53
  export {
51
54
  a as typographyVariants
52
55
  };
@@ -2,106 +2,107 @@ import { Alert as e } from "./Alert/Alert.js";
2
2
  import { AlertDialog as p } from "./AlertDialog/AlertDialog.js";
3
3
  import { Autocomplete as x } from "./Autocomplete/Autocomplete.js";
4
4
  import { Badge as a } from "./Badge/Badge.js";
5
- import { Breadcrumb as d } from "./Breadcrumb/Breadcrumb.js";
6
- import { Button as n } from "./Button/Button.js";
7
- import { Card as u } from "./Card/Card.js";
5
+ import { Breadcrumb as n } from "./Breadcrumb/Breadcrumb.js";
6
+ import { Button as l } from "./Button/Button.js";
7
+ import { Card as g } from "./Card/Card.js";
8
8
  import { Checkbox as c } from "./Checkbox/Checkbox.js";
9
- import { DatePicker as b } from "./Datepicker/DatePicker.js";
10
- import { Divider as s } from "./Divider/Divider.js";
11
- import { DropdownButton as C } from "./DropdownButton/DropdownButton.js";
12
- import { Filter as h } from "./Filter/Filter.js";
13
- import { ImageUpload as w } from "./ImageUpload/ImageUpload.js";
14
- import { Input as R } from "./Input/Input.js";
15
- import { Loading as I } from "./Loading/Loading.js";
16
- import { M as k } from "../Modal-CjC-CIJ8.js";
17
- import { MultiSelectDropdown as G } from "./MultiSelectDropdown/MultiSelectDropdown.js";
18
- import { NumberInput as y } from "./NumberInput/NumberInput.js";
19
- import { PhoneNumberInput as O } from "./PhoneNumberInput/PhoneNumberInput.js";
20
- import { PieChart as V } from "./PieChart/PieChart.js";
21
- import { ProgressBar as q } from "./ProgressBar/ProgressBar.js";
22
- import { Radio as H } from "./Radio/Radio.js";
23
- import { RadioCard as K } from "./RadioCard/RadioCard.js";
24
- import { RadioCardGroup as W } from "./RadioCardGroup/RadioCardGroup.js";
25
- import { RadioGroup as Y } from "./RadioGroup/RadioGroup.js";
26
- import { Range as _ } from "./Range/Range.js";
27
- import { Select as oo, Select as ro } from "./Select/Select.js";
28
- import { Sidebar as to } from "./Sidebar/Sidebar.js";
29
- import { Slider as mo } from "./Slider/Slider.js";
30
- import { Switch as fo } from "./Switch/Switch.js";
31
- import { Table as io } from "./Table/Table.js";
32
- import { Tabs as no } from "./Tabs/Tabs.js";
33
- import { Tag as uo } from "./Tag/Tag.js";
34
- import { TagSelect as co } from "./TagSelect/TagSelect.js";
35
- import { TextArea as bo } from "./TextArea/TextArea.js";
36
- import { TimePicker as so } from "./TimePicker/TimePicker.js";
37
- import { Toast as Co } from "./Toast/Toast.js";
38
- import { Tooltip as ho } from "./Tooltip/Tooltip.js";
39
- import { Typography as wo } from "./Typography/Typography.js";
40
- import { VirtualizedTable as Ro } from "./VirtualizedTable/VirtualizedTable.js";
41
- import { BadgeMultiSelect as Io } from "./Filter/components/BadgeDropdown/BadgeMultiSelect.js";
42
- import { DateFilterDropdown as ko } from "./Filter/components/DateFilterDropdown/DateFilterDropdown.js";
43
- import { Footer as Go } from "./Sidebar/components/Footer/Footer.js";
44
- import { Logo as yo } from "./Sidebar/components/Logo/Logo.js";
45
- import { Navigation as Oo } from "./Sidebar/components/Navigation/Navigation.js";
46
- import { NavigationGroup as Vo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
47
- import { NavigationOption as qo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
48
- import { NavigationSeparator as Ho } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
49
- import { Content as Ko } from "./Tabs/components/Content.js";
50
- import { List as Wo } from "./Tabs/components/List.js";
51
- import { Trigger as Yo } from "./Tabs/components/Trigger.js";
52
- import { TruncateText as _o } from "./VirtualizedTable/components/TruncateText/TruncateText.js";
9
+ import { Counter as b, Counter as s } from "./Counter/Counter.js";
10
+ import { DatePicker as D } from "./Datepicker/DatePicker.js";
11
+ import { Divider as N } from "./Divider/Divider.js";
12
+ import { DropdownButton as v } from "./DropdownButton/DropdownButton.js";
13
+ import { Filter as P } from "./Filter/Filter.js";
14
+ import { ImageUpload as A } from "./ImageUpload/ImageUpload.js";
15
+ import { Input as M } from "./Input/Input.js";
16
+ import { Loading as F } from "./Loading/Loading.js";
17
+ import { M as L } from "../Modal-CjC-CIJ8.js";
18
+ import { MultiSelectDropdown as z } from "./MultiSelectDropdown/MultiSelectDropdown.js";
19
+ import { PhoneNumberInput as U } from "./PhoneNumberInput/PhoneNumberInput.js";
20
+ import { PieChart as j } from "./PieChart/PieChart.js";
21
+ import { ProgressBar as E } from "./ProgressBar/ProgressBar.js";
22
+ import { Radio as J } from "./Radio/Radio.js";
23
+ import { RadioCard as Q } from "./RadioCard/RadioCard.js";
24
+ import { RadioCardGroup as X } from "./RadioCardGroup/RadioCardGroup.js";
25
+ import { RadioGroup as Z } from "./RadioGroup/RadioGroup.js";
26
+ import { Range as $ } from "./Range/Range.js";
27
+ import { Select as ro, Select as eo } from "./Select/Select.js";
28
+ import { Sidebar as po } from "./Sidebar/Sidebar.js";
29
+ import { Slider as xo } from "./Slider/Slider.js";
30
+ import { Switch as ao } from "./Switch/Switch.js";
31
+ import { Table as no } from "./Table/Table.js";
32
+ import { Tabs as uo } from "./Tabs/Tabs.js";
33
+ import { Tag as To } from "./Tag/Tag.js";
34
+ import { TagSelect as So } from "./TagSelect/TagSelect.js";
35
+ import { TextArea as so } from "./TextArea/TextArea.js";
36
+ import { TimePicker as Do } from "./TimePicker/TimePicker.js";
37
+ import { Toast as No } from "./Toast/Toast.js";
38
+ import { Tooltip as vo } from "./Tooltip/Tooltip.js";
39
+ import { Typography as Po } from "./Typography/Typography.js";
40
+ import { VirtualizedTable as Ao } from "./VirtualizedTable/VirtualizedTable.js";
41
+ import { BadgeMultiSelect as Mo } from "./Filter/components/BadgeDropdown/BadgeMultiSelect.js";
42
+ import { DateFilterDropdown as Fo } from "./Filter/components/DateFilterDropdown/DateFilterDropdown.js";
43
+ import { Footer as Lo } from "./Sidebar/components/Footer/Footer.js";
44
+ import { Logo as zo } from "./Sidebar/components/Logo/Logo.js";
45
+ import { Navigation as Uo } from "./Sidebar/components/Navigation/Navigation.js";
46
+ import { NavigationGroup as jo } from "./Sidebar/components/NavigationGroup/NavigationGroup.js";
47
+ import { NavigationOption as Eo } from "./Sidebar/components/NavigationOption/NavigationOption.js";
48
+ import { NavigationSeparator as Jo } from "./Sidebar/components/NavigationSeparator/NavigationSeparator.js";
49
+ import { Content as Qo } from "./Tabs/components/Content.js";
50
+ import { List as Xo } from "./Tabs/components/List.js";
51
+ import { Trigger as Zo } from "./Tabs/components/Trigger.js";
52
+ import { TruncateText as $o } from "./VirtualizedTable/components/TruncateText/TruncateText.js";
53
53
  export {
54
54
  e as Alert,
55
55
  p as AlertDialog,
56
56
  x as Autocomplete,
57
57
  a as Badge,
58
- Io as BadgeMultiSelect,
59
- d as Breadcrumb,
60
- n as Button,
61
- u as Card,
58
+ Mo as BadgeMultiSelect,
59
+ n as Breadcrumb,
60
+ l as Button,
61
+ g as Card,
62
62
  c as Checkbox,
63
- Ko as Content,
64
- ko as DateFilterDropdown,
65
- b as DatePicker,
66
- s as Divider,
67
- oo as Dropdown,
68
- C as DropdownButton,
69
- h as Filter,
70
- Go as Footer,
71
- w as ImageUpload,
72
- R as Input,
73
- Wo as List,
74
- I as Loading,
75
- yo as Logo,
76
- k as Modal,
77
- G as MultiSelectDropdown,
78
- Oo as Navigation,
79
- Vo as NavigationGroup,
80
- qo as NavigationOption,
81
- Ho as NavigationSeparator,
82
- y as NumberInput,
83
- O as PhoneNumberInput,
84
- V as PieChart,
85
- q as ProgressBar,
86
- H as Radio,
87
- K as RadioCard,
88
- W as RadioCardGroup,
89
- Y as RadioGroup,
90
- _ as Range,
91
- ro as Select,
92
- to as Sidebar,
93
- mo as Slider,
94
- fo as Switch,
95
- io as Table,
96
- no as Tabs,
97
- uo as Tag,
98
- co as TagSelect,
99
- bo as TextArea,
100
- so as TimePicker,
101
- Co as Toast,
102
- ho as Tooltip,
103
- Yo as Trigger,
104
- _o as TruncateText,
105
- wo as Typography,
106
- Ro as VirtualizedTable
63
+ Qo as Content,
64
+ b as Counter,
65
+ Fo as DateFilterDropdown,
66
+ D as DatePicker,
67
+ N as Divider,
68
+ ro as Dropdown,
69
+ v as DropdownButton,
70
+ P as Filter,
71
+ Lo as Footer,
72
+ A as ImageUpload,
73
+ M as Input,
74
+ Xo as List,
75
+ F as Loading,
76
+ zo as Logo,
77
+ L as Modal,
78
+ z as MultiSelectDropdown,
79
+ Uo as Navigation,
80
+ jo as NavigationGroup,
81
+ Eo as NavigationOption,
82
+ Jo as NavigationSeparator,
83
+ s as NumberInput,
84
+ U as PhoneNumberInput,
85
+ j as PieChart,
86
+ E as ProgressBar,
87
+ J as Radio,
88
+ Q as RadioCard,
89
+ X as RadioCardGroup,
90
+ Z as RadioGroup,
91
+ $ as Range,
92
+ eo as Select,
93
+ po as Sidebar,
94
+ xo as Slider,
95
+ ao as Switch,
96
+ no as Table,
97
+ uo as Tabs,
98
+ To as Tag,
99
+ So as TagSelect,
100
+ so as TextArea,
101
+ Do as TimePicker,
102
+ No as Toast,
103
+ vo as Tooltip,
104
+ Zo as Trigger,
105
+ $o as TruncateText,
106
+ Po as Typography,
107
+ Ao as VirtualizedTable
107
108
  };
package/dist/index.d.ts CHANGED
@@ -194,6 +194,33 @@ export declare type ColumnDef<TData extends RowData> = ColumnDef_2<TData, string
194
194
 
195
195
  export declare const Content: FC<TabsContentProps>;
196
196
 
197
+ declare const Counter: FC<CounterProps>;
198
+ export { Counter }
199
+ export { Counter as NumberInput }
200
+
201
+ declare interface CounterProps extends VariantProps<typeof counterVariants> {
202
+ canDecrement?: boolean;
203
+ canIncrement?: boolean;
204
+ className?: string;
205
+ decrementButtonClassName?: string;
206
+ incrementButtonClassName?: string;
207
+ init?: number;
208
+ isRequired?: boolean;
209
+ label?: string;
210
+ max?: number;
211
+ min?: number;
212
+ name?: string;
213
+ theme?: Theme;
214
+ value?: number;
215
+ onChange?: ({ target: { value } }: {
216
+ target: {
217
+ value: number;
218
+ };
219
+ }) => void;
220
+ }
221
+
222
+ declare const counterVariants: (props?: ClassProp | undefined) => string;
223
+
197
224
  declare type CSSColor = `var(--${string})` | `rgb(${number}, ${number}, ${number})` | `rgba(${number}, ${number}, ${number}, ${number})` | `hsl(${number}, ${number}%, ${number}%)` | `hsla(${number}, ${number}%, ${number}%, ${number})`;
198
225
 
199
226
  export declare const DateFilterDropdown: FC<DateFilterDropdownProps>;
@@ -458,26 +485,6 @@ declare const navigationTitleVariants: (props?: ClassProp | undefined) => string
458
485
 
459
486
  declare const navigationVariants: (props?: ClassProp | undefined) => string;
460
487
 
461
- export declare const NumberInput: FC<NumberInputProps>;
462
-
463
- declare interface NumberInputProps extends VariantProps<typeof numberInputVariants> {
464
- className?: string;
465
- init?: number;
466
- label?: string | ReactNode;
467
- max?: number;
468
- min?: number;
469
- name?: string;
470
- value?: number;
471
- theme?: Theme;
472
- onChange?: ({ target: { value } }: {
473
- target: {
474
- value: number;
475
- };
476
- }) => void;
477
- }
478
-
479
- declare const numberInputVariants: (props?: ClassProp | undefined) => string;
480
-
481
488
  declare type OnBlurFn = (event: {
482
489
  target: HTMLInputElement | null;
483
490
  type?: string;
@@ -1011,7 +1018,7 @@ declare type TimePickerProps = VariantProps<typeof timePickerVariants> & {
1011
1018
  time?: Date;
1012
1019
  name?: string;
1013
1020
  label?: string;
1014
- required?: boolean;
1021
+ isRequired?: boolean;
1015
1022
  className?: string;
1016
1023
  listClassName?: string;
1017
1024
  listItemClassName?: string;