@david-richard/notify-ds 1.1.0 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { Search, Hide, View, XCircle, Info, Check, Minus, ChevronDown, ChevronRight, ArrowUp2, ArrowDown2 } from './chunk-O55YYDMU.mjs';
1
2
  import * as React4 from 'react';
2
3
  import { Slot } from '@radix-ui/react-slot';
3
4
  import { cva } from 'class-variance-authority';
@@ -5,7 +6,6 @@ import { clsx } from 'clsx';
5
6
  import { twMerge } from 'tailwind-merge';
6
7
  import { jsx, jsxs } from 'react/jsx-runtime';
7
8
 
8
- // components/button.tsx
9
9
  function cn(...inputs) {
10
10
  return twMerge(clsx(inputs));
11
11
  }
@@ -154,7 +154,7 @@ var InputField = React4.forwardRef(
154
154
  required && /* @__PURE__ */ jsx("span", { className: "text-[var(--color-brand-red,#EF2149)]", "aria-hidden": "true", children: " *" })
155
155
  ] }),
156
156
  /* @__PURE__ */ jsxs("div", { className: pillVariants({ state }), children: [
157
- type === "search" && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconColor), "aria-hidden": "true", children: /* @__PURE__ */ jsx(SearchIcon, {}) }),
157
+ type === "search" && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconColor), "aria-hidden": "true", children: /* @__PURE__ */ jsx(Search, { size: 16 }) }),
158
158
  /* @__PURE__ */ jsx(
159
159
  "input",
160
160
  {
@@ -187,7 +187,7 @@ var InputField = React4.forwardRef(
187
187
  onClick: () => setShowPassword((v) => !v),
188
188
  className: cn("shrink-0 cursor-pointer", iconColor),
189
189
  "aria-label": showPassword ? "Hide password" : "Show password",
190
- children: showPassword ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
190
+ children: showPassword ? /* @__PURE__ */ jsx(Hide, { size: 16 }) : /* @__PURE__ */ jsx(View, { size: 16 })
191
191
  }
192
192
  ),
193
193
  !rightSlot && type === "search" && hasValue && !disabled && /* @__PURE__ */ jsx(
@@ -198,10 +198,10 @@ var InputField = React4.forwardRef(
198
198
  onClick: () => setHasValue(false),
199
199
  className: cn("shrink-0 cursor-pointer", iconColor),
200
200
  "aria-label": "Clear search",
201
- children: /* @__PURE__ */ jsx(XCircleIcon, {})
201
+ children: /* @__PURE__ */ jsx(XCircle, { size: 16 })
202
202
  }
203
203
  ),
204
- !rightSlot && state === "error" && type !== "password" && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconColor), "aria-hidden": "true", children: /* @__PURE__ */ jsx(InfoCircleIcon, {}) })
204
+ !rightSlot && state === "error" && type !== "password" && /* @__PURE__ */ jsx("span", { className: cn("shrink-0", iconColor), "aria-hidden": "true", children: /* @__PURE__ */ jsx(Info, { size: 16 }) })
205
205
  ] }),
206
206
  (errorMessage || helperText) && /* @__PURE__ */ jsx(
207
207
  "p",
@@ -217,39 +217,6 @@ var InputField = React4.forwardRef(
217
217
  }
218
218
  );
219
219
  InputField.displayName = "InputField";
220
- function SearchIcon() {
221
- return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
222
- /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "4.5" }),
223
- /* @__PURE__ */ jsx("line", { x1: "10.5", y1: "10.5", x2: "14", y2: "14" })
224
- ] });
225
- }
226
- function EyeIcon() {
227
- return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
228
- /* @__PURE__ */ jsx("path", { d: "M1 8s2.5-5 7-5 7 5 7 5-2.5 5-7 5-7-5-7-5Z" }),
229
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "2" })
230
- ] });
231
- }
232
- function EyeOffIcon() {
233
- return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
234
- /* @__PURE__ */ jsx("path", { d: "M2 2l12 12M6.5 6.5A2 2 0 0 0 9.5 9.5" }),
235
- /* @__PURE__ */ jsx("path", { d: "M4.2 4.2C2.6 5.2 1 8 1 8s2.5 5 7 5c1.4 0 2.7-.4 3.8-1" }),
236
- /* @__PURE__ */ jsx("path", { d: "M9.8 3.2C12.2 4.2 15 8 15 8s-.7 1.4-1.8 2.6" })
237
- ] });
238
- }
239
- function XCircleIcon() {
240
- return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
241
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.5" }),
242
- /* @__PURE__ */ jsx("line", { x1: "5.5", y1: "5.5", x2: "10.5", y2: "10.5" }),
243
- /* @__PURE__ */ jsx("line", { x1: "10.5", y1: "5.5", x2: "5.5", y2: "10.5" })
244
- ] });
245
- }
246
- function InfoCircleIcon() {
247
- return /* @__PURE__ */ jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
248
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "8", r: "6.5" }),
249
- /* @__PURE__ */ jsx("line", { x1: "8", y1: "7", x2: "8", y2: "11" }),
250
- /* @__PURE__ */ jsx("circle", { cx: "8", cy: "5", r: "0.5", fill: "currentColor", stroke: "none" })
251
- ] });
252
- }
253
220
  var Checkbox = React4.forwardRef(
254
221
  ({ label, indeterminate, helperText, disabled, checked, defaultChecked, className, onChange, ...props }, ref) => {
255
222
  const internalRef = React4.useRef(null);
@@ -299,8 +266,8 @@ var Checkbox = React4.forwardRef(
299
266
  showCheck || showDash ? "border-transparent bg-[var(--color-secondary,#339FB8)] text-[var(--color-foreground,#000)]" : "border-[var(--color-secondary,#339FB8)] bg-transparent"
300
267
  ),
301
268
  children: [
302
- showCheck && /* @__PURE__ */ jsx(CheckIcon, {}),
303
- showDash && /* @__PURE__ */ jsx(DashIcon, {})
269
+ showCheck && /* @__PURE__ */ jsx(Check, { size: 12 }),
270
+ showDash && /* @__PURE__ */ jsx(Minus, { size: 12 })
304
271
  ]
305
272
  }
306
273
  ),
@@ -314,12 +281,6 @@ var Checkbox = React4.forwardRef(
314
281
  }
315
282
  );
316
283
  Checkbox.displayName = "Checkbox";
317
- function CheckIcon() {
318
- return /* @__PURE__ */ jsx("svg", { width: "11", height: "8", viewBox: "0 0 11 8", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "1,4 4,7 10,1" }) });
319
- }
320
- function DashIcon() {
321
- return /* @__PURE__ */ jsx("svg", { width: "10", height: "2", viewBox: "0 0 10 2", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: /* @__PURE__ */ jsx("line", { x1: "1", y1: "1", x2: "9", y2: "1" }) });
322
- }
323
284
  var Radio = React4.forwardRef(
324
285
  ({ label, helperText, disabled, checked, defaultChecked, className, onChange, ...props }, ref) => {
325
286
  const [isChecked, setIsChecked] = React4.useState(!!defaultChecked);
@@ -562,8 +523,9 @@ var Selector = React4.forwardRef(
562
523
  icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 [&_svg]:size-4", children: icon }),
563
524
  /* @__PURE__ */ jsx("span", { children: label }),
564
525
  /* @__PURE__ */ jsx(
565
- ChevronDownIcon,
526
+ ChevronDown,
566
527
  {
528
+ size: 12,
567
529
  className: cn(
568
530
  "shrink-0 transition-transform duration-[120ms]",
569
531
  open && "rotate-180"
@@ -579,23 +541,6 @@ Selector.displayName = "Selector";
579
541
  function SelectorGroup({ children, className }) {
580
542
  return /* @__PURE__ */ jsx("div", { className: cn("flex flex-wrap items-center gap-2", className), children });
581
543
  }
582
- function ChevronDownIcon({ className }) {
583
- return /* @__PURE__ */ jsx(
584
- "svg",
585
- {
586
- width: "12",
587
- height: "12",
588
- viewBox: "0 0 12 12",
589
- fill: "none",
590
- stroke: "currentColor",
591
- strokeWidth: "1.5",
592
- strokeLinecap: "round",
593
- strokeLinejoin: "round",
594
- className,
595
- children: /* @__PURE__ */ jsx("polyline", { points: "2,4 6,8 10,4" })
596
- }
597
- );
598
- }
599
544
  function TabBar({
600
545
  tabs,
601
546
  value,
@@ -854,14 +799,14 @@ function Badge({ variant, size, icon, children, className, ...props }) {
854
799
  function TrendBadge({ value, decimals = 1, showArrow = true, className, ...props }) {
855
800
  const colorClass = value > 0 ? "text-[var(--color-success,#16A34A)]" : value < 0 ? "text-[var(--color-destructive,#EF2149)]" : "text-[var(--color-text-tertiary,#6B7280)]";
856
801
  const formatted = `${value > 0 ? "+" : ""}${value.toFixed(decimals)}%`;
857
- const arrow = showArrow ? value > 0 ? /* @__PURE__ */ jsx(ArrowUpIcon, {}) : value < 0 ? /* @__PURE__ */ jsx(ArrowDownIcon, {}) : null : null;
802
+ const arrow = showArrow ? value > 0 ? /* @__PURE__ */ jsx(ArrowUp2, {}) : value < 0 ? /* @__PURE__ */ jsx(ArrowDown2, {}) : null : null;
858
803
  return /* @__PURE__ */ jsxs(
859
804
  "span",
860
805
  {
861
806
  className: cn(
862
807
  "inline-flex items-center gap-1 whitespace-nowrap select-none",
863
- "font-['Inter'] text-[12px] font-medium leading-tight",
864
- "[&_svg]:size-3",
808
+ "font-['Inter'] text-[13px] font-medium leading-tight",
809
+ "[&_svg]:size-3.5",
865
810
  colorClass,
866
811
  className
867
812
  ),
@@ -873,12 +818,6 @@ function TrendBadge({ value, decimals = 1, showArrow = true, className, ...props
873
818
  }
874
819
  );
875
820
  }
876
- function ArrowUpIcon() {
877
- return /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "2,7 5,3 8,7" }) });
878
- }
879
- function ArrowDownIcon() {
880
- return /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 10 10", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("polyline", { points: "2,3 5,7 8,3" }) });
881
- }
882
821
  function MetricTile({
883
822
  label,
884
823
  value,
@@ -893,9 +832,9 @@ function MetricTile({
893
832
  as: Tag = "div"
894
833
  }) {
895
834
  const valueSize = {
896
- sm: "text-[18px]",
897
- md: "text-[24px]",
898
- lg: "text-[30px]"
835
+ sm: "text-[22px]",
836
+ md: "text-[28px]",
837
+ lg: "text-[34px]"
899
838
  }[size];
900
839
  const padding = {
901
840
  sm: "p-3",
@@ -929,14 +868,14 @@ function MetricTile({
929
868
  "span",
930
869
  {
931
870
  className: cn(
932
- "font-['Inter'] text-[12px] font-normal leading-tight",
871
+ "font-['Inter'] text-[14px] font-normal leading-tight",
933
872
  "text-[var(--color-text-tertiary,#6B7280)]",
934
873
  loading && "h-3 w-24 rounded bg-gray-200"
935
874
  ),
936
875
  children: !loading && label
937
876
  }
938
877
  ),
939
- !loading && (icon ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[var(--color-text-tertiary,#6B7280)] [&_svg]:size-4", "aria-hidden": "true", children: icon }) : onClick ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[var(--color-text-tertiary,#6B7280)] [&_svg]:size-3.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) }) : null)
878
+ !loading && (icon ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[var(--color-text-tertiary,#6B7280)] [&_svg]:size-4", "aria-hidden": "true", children: icon }) : onClick ? /* @__PURE__ */ jsx("span", { className: "shrink-0 text-[var(--color-text-tertiary,#6B7280)]", "aria-hidden": "true", children: /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) }) : null)
940
879
  ] }),
941
880
  /* @__PURE__ */ jsx(
942
881
  "span",
@@ -950,9 +889,9 @@ function MetricTile({
950
889
  children: !loading && value
951
890
  }
952
891
  ),
953
- (trend !== void 0 || trendLabel) && !loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
954
- trendLabel && /* @__PURE__ */ jsx("span", { className: "font-['Inter'] text-[12px] text-[var(--color-text-tertiary,#6B7280)]", children: trendLabel }),
955
- trend !== void 0 && /* @__PURE__ */ jsx(TrendBadge, { value: trend })
892
+ (trend !== void 0 || trendLabel) && !loading && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
893
+ trendLabel ? /* @__PURE__ */ jsx("span", { className: "font-['Inter'] text-[13px] text-[var(--color-text-tertiary,#6B7280)]", children: trendLabel }) : /* @__PURE__ */ jsx("span", {}),
894
+ trend !== void 0 ? /* @__PURE__ */ jsx(TrendBadge, { value: trend }) : /* @__PURE__ */ jsx("span", {})
956
895
  ] }),
957
896
  loading && trend !== void 0 && /* @__PURE__ */ jsx("div", { className: "mt-1 h-4 w-16 rounded bg-gray-200" })
958
897
  ]
@@ -968,9 +907,6 @@ function MetricTileGrid({ cols = 2, children, className }) {
968
907
  }[cols];
969
908
  return /* @__PURE__ */ jsx("div", { className: cn("grid gap-3", colClass, className), children });
970
909
  }
971
- function ChevronRightIcon() {
972
- return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 14 14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("polyline", { points: "5,3 9,7 5,11" }) });
973
- }
974
910
 
975
911
  export { Badge, BottomNav, BottomNavContainer, Button, Checkbox, IconButton, InputField, MetricTile, MetricTileGrid, Radio, RadioGroup, Selector, SelectorGroup, Switcher, TabBar, TabPanel, TabPanels, Toggle, TrendBadge, buttonVariants };
976
912
  //# sourceMappingURL=index.mjs.map