@ngrr/ds 0.1.8 → 0.1.9

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,6 +1,5 @@
1
1
  import { LucideIcon } from 'lucide-react';
2
2
  export type TagVariant = 'highlight' | 'warning' | 'error' | 'success' | 'neutral';
3
- export type TagSize = 'md' | 'sm';
4
3
  export interface TagProps {
5
4
  /**
6
5
  * The text label displayed inside the tag.
@@ -18,24 +17,15 @@ export interface TagProps {
18
17
  */
19
18
  variant?: TagVariant;
20
19
  /**
21
- * Visual size.
22
- * - `md` default; use in most contexts
23
- * - `sm` — dense layouts, tight rows, or when multiple tags appear per item
24
- * @default 'md'
20
+ * Optional Lucide icon shown to the left of the label.
21
+ * Pass the component reference: `iconLeft={Star}` ✓ `iconLeft={<Star />}`
25
22
  */
26
- size?: TagSize;
23
+ iconLeft?: LucideIcon;
27
24
  /**
28
- * Replaces the default diamond indicator with any Lucide icon.
29
- * Pass the component reference, not a rendered element:
30
- * `icon={Star}` ✓ `icon={<Star />}` ✗
31
- * When omitted the built-in CSS diamond shape is rendered.
25
+ * Optional Lucide icon shown to the right of the label.
26
+ * Pass the component reference: `iconRight={X}` ✓ `iconRight={<X />}`
32
27
  */
33
- icon?: LucideIcon;
34
- /**
35
- * When `false`, the icon (default diamond or custom) is hidden and only the
36
- * label text is shown. Defaults to `true`.
37
- */
38
- showIcon?: boolean;
28
+ iconRight?: LucideIcon;
39
29
  /** Additional CSS class names merged onto the root element. */
40
30
  className?: string;
41
31
  /**
@@ -47,4 +37,4 @@ export interface TagProps {
47
37
  */
48
38
  'aria-label'?: string;
49
39
  }
50
- export declare function Tag({ label, variant, size, icon, showIcon, className, 'aria-label': ariaLabel, }: TagProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function Tag({ label, variant, iconLeft, iconRight, className, 'aria-label': ariaLabel, }: TagProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  export { Tag } from './Tag';
2
- export type { TagProps, TagVariant, TagSize } from './Tag';
2
+ export type { TagProps, TagVariant } from './Tag';
@@ -1616,27 +1616,29 @@ function A7({
1616
1616
  function xi({
1617
1617
  label: e,
1618
1618
  variant: t = "neutral",
1619
- size: n = "md",
1620
- icon: r,
1621
- showIcon: i = !0,
1622
- className: a,
1623
- "aria-label": s
1619
+ iconLeft: n,
1620
+ iconRight: r,
1621
+ className: i,
1622
+ "aria-label": a
1624
1623
  }) {
1625
- const o = ["dsn-tag", a].filter(Boolean).join(" ");
1624
+ const s = ["dsn-tag", i].filter(Boolean).join(" ");
1626
1625
  return /* @__PURE__ */ h.jsxs(
1627
1626
  "span",
1628
1627
  {
1629
- className: o,
1628
+ className: s,
1630
1629
  "data-variant": t,
1631
- "data-size": n,
1632
1630
  role: "status",
1633
- "aria-label": s,
1631
+ "aria-label": a,
1634
1632
  children: [
1635
- i && /* @__PURE__ */ h.jsx("span", { className: "dsn-tag-icon", "aria-hidden": "true", "data-icon": r ? "custom" : void 0, children: r && /* @__PURE__ */ (() => {
1636
- const l = r;
1637
- return /* @__PURE__ */ h.jsx(l, { size: 12, "aria-hidden": "true" });
1638
- })() }),
1639
- /* @__PURE__ */ h.jsx("span", { className: "dsn-tag-label", children: e })
1633
+ n && /* @__PURE__ */ (() => {
1634
+ const o = n;
1635
+ return /* @__PURE__ */ h.jsx("span", { className: "dsn-tag-icon dsn-tag-icon-left", "aria-hidden": "true", children: /* @__PURE__ */ h.jsx(o, { size: 12, "aria-hidden": "true" }) });
1636
+ })(),
1637
+ /* @__PURE__ */ h.jsx("span", { className: "dsn-tag-label", children: e }),
1638
+ r && /* @__PURE__ */ (() => {
1639
+ const o = r;
1640
+ return /* @__PURE__ */ h.jsx("span", { className: "dsn-tag-icon dsn-tag-icon-right", "aria-hidden": "true", children: /* @__PURE__ */ h.jsx(o, { size: 12, "aria-hidden": "true" }) });
1641
+ })()
1640
1642
  ]
1641
1643
  }
1642
1644
  );