@brett_lamy/ui 5.0.0 → 5.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.
@@ -0,0 +1,110 @@
1
+ "use client";
2
+ import { cn as e } from "../lib/utils.js";
3
+ import { Icon as t } from "../lib/icon.js";
4
+ import { Button as n } from "./button.js";
5
+ import { Popover as r } from "./popover.js";
6
+ import { Calendar as i, RangeCalendar as a } from "./calendar.js";
7
+ import { DateInput as o } from "./date-field.js";
8
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
+ import { DatePicker as l, DateRangePicker as u, Dialog as d, Group as f, composeRenderProps as p } from "react-aria-components";
10
+ import { cva as m } from "class-variance-authority";
11
+ //#region src/components/date-picker.tsx
12
+ var h = m([
13
+ "flex min-w-0 items-center gap-1 bg-input pl-3 pr-1.5 text-foreground outline-none transition-[box-shadow,background-color] duration-spring-snappy ease-spring-snappy",
14
+ "data-focus-within:bg-transparent data-focus-within:ring-[1.5px] data-focus-within:ring-primary data-focus-within:ring-inset",
15
+ "group-data-open:bg-transparent group-data-open:ring-[1.5px] group-data-open:ring-primary group-data-open:ring-inset",
16
+ "data-invalid:ring-[1.5px] data-invalid:ring-destructive data-invalid:ring-inset data-disabled:cursor-not-allowed data-disabled:opacity-50"
17
+ ], {
18
+ variants: { size: {
19
+ sm: "h-8 rounded-lg text-subhead",
20
+ default: "h-11 rounded-ctl text-body",
21
+ lg: "h-[50px] rounded-xl text-body"
22
+ } },
23
+ defaultVariants: { size: "default" }
24
+ });
25
+ function g() {
26
+ return /* @__PURE__ */ s(n, {
27
+ variant: "quiet",
28
+ size: "icon",
29
+ className: "size-8 shrink-0",
30
+ children: /* @__PURE__ */ s(t, {
31
+ name: "calendar",
32
+ size: 18
33
+ })
34
+ });
35
+ }
36
+ function _({ className: t, size: n }) {
37
+ return /* @__PURE__ */ c(f, {
38
+ "data-slot": "date-picker-field",
39
+ className: e(h({ size: n }), t),
40
+ children: [/* @__PURE__ */ s(o, {
41
+ variant: "bare",
42
+ size: n
43
+ }), /* @__PURE__ */ s(g, {})]
44
+ });
45
+ }
46
+ function v({ className: t, size: n }) {
47
+ return /* @__PURE__ */ c(f, {
48
+ "data-slot": "date-range-picker-field",
49
+ className: e(h({ size: n }), t),
50
+ children: [
51
+ /* @__PURE__ */ s(o, {
52
+ variant: "bare",
53
+ size: n,
54
+ slot: "start",
55
+ className: "flex-none"
56
+ }),
57
+ /* @__PURE__ */ s("span", {
58
+ "aria-hidden": "true",
59
+ className: "px-1 text-muted-foreground",
60
+ children: "–"
61
+ }),
62
+ /* @__PURE__ */ s(o, {
63
+ variant: "bare",
64
+ size: n,
65
+ slot: "end"
66
+ }),
67
+ /* @__PURE__ */ s(g, {})
68
+ ]
69
+ });
70
+ }
71
+ function y({ children: e }) {
72
+ return /* @__PURE__ */ s(d, {
73
+ className: "p-3 outline-none",
74
+ children: e
75
+ });
76
+ }
77
+ function b({ calendarProps: t, children: n, placement: a = "bottom start", className: o, ...c }) {
78
+ return /* @__PURE__ */ s(r, {
79
+ "data-slot": "date-picker-content",
80
+ placement: a,
81
+ ...c,
82
+ className: p(o, (t) => e("min-w-0", t)),
83
+ children: /* @__PURE__ */ s(y, { children: n ?? /* @__PURE__ */ s(i, { ...t }) })
84
+ });
85
+ }
86
+ function x({ calendarProps: t, children: n, placement: i = "bottom start", className: o, ...c }) {
87
+ return /* @__PURE__ */ s(r, {
88
+ "data-slot": "date-range-picker-content",
89
+ placement: i,
90
+ ...c,
91
+ className: p(o, (t) => e("min-w-0", t)),
92
+ children: /* @__PURE__ */ s(y, { children: n ?? /* @__PURE__ */ s(a, { ...t }) })
93
+ });
94
+ }
95
+ function S({ className: t, ...n }) {
96
+ return /* @__PURE__ */ s(l, {
97
+ "data-slot": "date-picker",
98
+ className: p(t, (t) => e("group flex flex-col gap-1.5", t)),
99
+ ...n
100
+ });
101
+ }
102
+ function C({ className: t, ...n }) {
103
+ return /* @__PURE__ */ s(u, {
104
+ "data-slot": "date-range-picker",
105
+ className: p(t, (t) => e("group flex flex-col gap-1.5", t)),
106
+ ...n
107
+ });
108
+ }
109
+ //#endregion
110
+ export { S as DatePicker, b as DatePickerContent, _ as DatePickerField, C as DateRangePicker, x as DateRangePickerContent, v as DateRangePickerField, h as datePickerFieldVariants };
@@ -248,6 +248,42 @@ export declare const SHAPES: {
248
248
  };
249
249
  render: (name: string, v: Variant) => import("react/jsx-runtime").JSX.Element;
250
250
  };
251
+ robot: {
252
+ label: string;
253
+ variants: {
254
+ blink: {
255
+ duration: number;
256
+ delays: number[];
257
+ };
258
+ look: {
259
+ duration: number;
260
+ delays: number[];
261
+ };
262
+ think: {
263
+ duration: number;
264
+ delays: number[];
265
+ };
266
+ };
267
+ render: (name: string, v: Variant) => import("react/jsx-runtime").JSX.Element;
268
+ };
269
+ kettle: {
270
+ label: string;
271
+ variants: {
272
+ whistle: {
273
+ duration: number;
274
+ delays: number[];
275
+ };
276
+ boil: {
277
+ duration: number;
278
+ delays: number[];
279
+ };
280
+ steam: {
281
+ duration: number;
282
+ delays: number[];
283
+ };
284
+ };
285
+ render: (name: string, v: Variant) => import("react/jsx-runtime").JSX.Element;
286
+ };
251
287
  };
252
288
  export type ShapeAnimation = keyof typeof SHAPES;
253
289
  export type ShapeVariant = {
@@ -1 +1 @@
1
- {"version":3,"file":"spinner-shapes.d.ts","sourceRoot":"","sources":["../../src/components/spinner-shapes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAa,MAAM,OAAO,CAAC;AAStD,UAAU,OAAO;IACf,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kFAAkF;IAClF,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AA6CD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsIvK,CAAC;AAElC,MAAM,MAAM,cAAc,GAAG,MAAM,OAAO,MAAM,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG;KAAG,CAAC,IAAI,cAAc,GAAG,MAAM,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;CAAE,CAAC,cAAc,CAAC,CAAC;AAE3G,eAAO,MAAM,SAAS,EAA0B,cAAc,EAAE,CAAC;AAEjE,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE;IAAE,SAAS,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,2CAIjG"}
@@ -761,6 +761,111 @@ var r = (e, t, n = 0) => Array.from({ length: e }, (e, r) => n + r * t), i = (e)
761
761
  style: c(i, n)
762
762
  }, e))
763
763
  ] }))
764
+ },
765
+ robot: {
766
+ label: "Robot",
767
+ variants: {
768
+ blink: {
769
+ duration: 3e3,
770
+ delays: [0, 0]
771
+ },
772
+ look: {
773
+ duration: 3400,
774
+ delays: [0, 0]
775
+ },
776
+ think: {
777
+ duration: 2400,
778
+ delays: [0, 0]
779
+ }
780
+ },
781
+ render: (r, i) => u(r, /* @__PURE__ */ n(e, { children: [/* @__PURE__ */ t("path", {
782
+ className: "bl-ld-rb-stand",
783
+ d: "M12 14.4V20.5M7.6 20.5H16.4"
784
+ }), /* @__PURE__ */ n("g", {
785
+ className: r === "think" ? "bl-ld-a bl-ld-rb-rock" : "bl-ld-rb-rock",
786
+ style: c(i, 0),
787
+ children: [/* @__PURE__ */ t("rect", {
788
+ className: "bl-ld-rb-head",
789
+ x: "4.5",
790
+ y: "2.8",
791
+ width: "15",
792
+ height: "11.6",
793
+ rx: "4"
794
+ }), /* @__PURE__ */ t("g", {
795
+ className: r === "look" ? "bl-ld-a bl-ld-rb-gaze" : "bl-ld-rb-gaze",
796
+ style: c(i, 0),
797
+ children: [9.2, 14.8].map((e, n) => /* @__PURE__ */ t("circle", {
798
+ className: "bl-ld-a bl-ld-fb bl-ld-rb-eye",
799
+ cx: e,
800
+ cy: "8.6",
801
+ r: "1.35",
802
+ style: c(i, n)
803
+ }, e))
804
+ })]
805
+ })] }))
806
+ },
807
+ kettle: {
808
+ label: "Kettle",
809
+ variants: {
810
+ whistle: {
811
+ duration: 1500,
812
+ delays: [
813
+ 0,
814
+ 380,
815
+ 760,
816
+ 0,
817
+ 0
818
+ ]
819
+ },
820
+ boil: {
821
+ duration: 1100,
822
+ delays: [
823
+ 0,
824
+ 280,
825
+ 560,
826
+ 0,
827
+ 0
828
+ ]
829
+ },
830
+ steam: {
831
+ duration: 2600,
832
+ delays: [
833
+ 0,
834
+ 850,
835
+ 1700,
836
+ 0,
837
+ 0
838
+ ]
839
+ }
840
+ },
841
+ render: (r, i) => u(r, /* @__PURE__ */ n(e, { children: [[
842
+ 9.4,
843
+ 12,
844
+ 14.6
845
+ ].map((e, n) => /* @__PURE__ */ t("path", {
846
+ className: "bl-ld-a bl-ld-kt-steam",
847
+ d: `M${e} 9.4c-1.1-1.1 1.1-2.1 0-3.4`,
848
+ style: c(i, n)
849
+ }, e)), /* @__PURE__ */ n("g", {
850
+ className: r === "whistle" ? "bl-ld-a bl-ld-kt-body" : "bl-ld-kt-body",
851
+ style: c(i, 4),
852
+ children: [/* @__PURE__ */ t("path", {
853
+ className: "bl-ld-kt-line",
854
+ d: "M5.6 20.5c0-4.3 2.1-7 6.4-7s6.4 2.7 6.4 7zM6.6 16.4 3.2 13.4M17.9 15.6c3.5-.3 3.7 4.4.3 4.7"
855
+ }), /* @__PURE__ */ n("g", {
856
+ className: r === "boil" ? "bl-ld-a bl-ld-kt-lid" : "bl-ld-kt-lid",
857
+ style: c(i, 3),
858
+ children: [/* @__PURE__ */ t("path", {
859
+ className: "bl-ld-kt-line",
860
+ d: "M10 13.5h4"
861
+ }), /* @__PURE__ */ t("circle", {
862
+ className: "bl-ld-kt-knob",
863
+ cx: "12",
864
+ cy: "12.2",
865
+ r: "1"
866
+ })]
867
+ })]
868
+ })] }))
764
869
  }
765
870
  }, f = Object.keys(d);
766
871
  function p({ animation: n, variant: r }) {
@@ -135,7 +135,7 @@ export interface SpinnerProps {
135
135
  }
136
136
  /** A loading indicator. The default is the iOS activity indicator (eight fading spokes, stepped rotation); it grows in
137
137
  when it mounts (a spinner appearing is an event; popping in unannounced reads as a glitch). `animation` picks one of
138
- one of the twenty loaders instead. */
138
+ one of the twenty-two loaders instead. */
139
139
  export declare function Spinner({ animation, variant, spin, size, speed, paused, label, className, style }: SpinnerProps): import("react/jsx-runtime").JSX.Element;
140
140
  export {};
141
141
  //# sourceMappingURL=spinner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAExE,OAAO,EAAkC,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAC;AA4B1G,yGAAyG;AACzG,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCqC,CAAC;AAEpD,KAAK,eAAe,GAAG,MAAM,OAAO,QAAQ,CAAC;AAC7C,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,eAAe,GAAG,cAAc,CAAC;AACxE,qGAAqG;AACrG,MAAM,MAAM,cAAc,GAAG;KAAG,CAAC,IAAI,eAAe,GAAG,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,eAAe,CAAC,GAAG,YAAY,CAAC;AA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