@dimaan/ui 0.0.23 → 0.0.24

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/README.md CHANGED
@@ -4,6 +4,7 @@ Shared React UI component library for Diman company projects.
4
4
 
5
5
  Built with **React 19**, **TypeScript**, **Tailwind CSS v4**, and a CSS-first design token system. Distributed as dual ESM/CJS with full type definitions, intended for Vite-based dashboard apps.
6
6
 
7
+
7
8
  ## Documentation
8
9
 
9
10
  - **[USAGE.md](USAGE.md)** — full consumer guide: install, Tailwind setup, framework-specific examples (Next.js / Vite / Remix), theming, and pitfalls.
package/dist/index.cjs CHANGED
@@ -136,7 +136,7 @@ var buttonSizeClass = {
136
136
  icon: "h-9 w-9 shrink-0 rounded-md p-0",
137
137
  "icon-sm": "h-8 w-8 shrink-0 rounded-md p-0"
138
138
  };
139
- var buttonBaseClass = "group/button relative inline-flex items-center justify-center font-medium select-none whitespace-nowrap outline-none transition-[background-color,color,box-shadow,opacity] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0";
139
+ var buttonBaseClass = "group/button relative inline-flex items-center justify-center font-medium select-none whitespace-nowrap outline-none transition-[background-color,color,box-shadow,opacity,transform] active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 motion-reduce:transition-none motion-reduce:active:scale-100 [&_svg]:pointer-events-none [&_svg]:shrink-0";
140
140
  var Button = react.forwardRef(function Button2({
141
141
  variant = "primary",
142
142
  size = "md",
@@ -3273,6 +3273,57 @@ var RadioGroupItem = react.forwardRef(function RadioGroupItem2({ className, radi
3273
3273
  );
3274
3274
  });
3275
3275
 
3276
+ // src/components/row-actions/rowActionsVariants.ts
3277
+ var rowActionsBaseClass = "inline-flex items-center gap-1";
3278
+ var rowActionsDestructiveClass = "text-destructive hover:bg-destructive/10 hover:text-destructive focus-visible:ring-destructive/40";
3279
+ var PRESETS = {
3280
+ view: { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, {}), label: "View", destructive: false },
3281
+ edit: { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, {}), label: "Edit", destructive: false },
3282
+ delete: { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, {}), label: "Delete", destructive: true }
3283
+ };
3284
+ function isPreset(action) {
3285
+ return "kind" in action;
3286
+ }
3287
+ function resolveAction(action) {
3288
+ if (isPreset(action)) {
3289
+ const preset = PRESETS[action.kind];
3290
+ return {
3291
+ icon: preset.icon,
3292
+ label: action.label ?? preset.label,
3293
+ destructive: preset.destructive,
3294
+ onClick: action.onClick,
3295
+ disabled: action.disabled ?? false
3296
+ };
3297
+ }
3298
+ return {
3299
+ icon: action.icon,
3300
+ label: action.label,
3301
+ destructive: action.variant === "destructive",
3302
+ onClick: action.onClick,
3303
+ disabled: action.disabled ?? false
3304
+ };
3305
+ }
3306
+ function RowActions({ actions, size = "icon-sm", className }) {
3307
+ if (actions.length === 0) return null;
3308
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(rowActionsBaseClass, className), children: actions.map((action, index) => {
3309
+ const resolved = resolveAction(action);
3310
+ return /* @__PURE__ */ jsxRuntime.jsx(
3311
+ Button,
3312
+ {
3313
+ type: "button",
3314
+ variant: "ghost",
3315
+ size,
3316
+ "aria-label": resolved.label,
3317
+ disabled: resolved.disabled,
3318
+ onClick: resolved.onClick,
3319
+ className: resolved.destructive ? rowActionsDestructiveClass : void 0,
3320
+ children: resolved.icon
3321
+ },
3322
+ index
3323
+ );
3324
+ }) });
3325
+ }
3326
+
3276
3327
  // src/components/switch/switchVariants.ts
3277
3328
  var switchTrackClass = {
3278
3329
  sm: "h-4 w-7",
@@ -3571,6 +3622,7 @@ exports.MultiSelect = MultiSelect;
3571
3622
  exports.PageHeader = PageHeader;
3572
3623
  exports.RadioGroup = RadioGroup;
3573
3624
  exports.RadioGroupItem = RadioGroupItem;
3625
+ exports.RowActions = RowActions;
3574
3626
  exports.Select = Select;
3575
3627
  exports.Sidebar = Sidebar;
3576
3628
  exports.SidebarFooter = SidebarFooter;
@@ -3684,6 +3736,8 @@ exports.radioItemBaseClass = radioItemBaseClass;
3684
3736
  exports.radioItemSizeClass = radioItemSizeClass;
3685
3737
  exports.radioLabelSizeClass = radioLabelSizeClass;
3686
3738
  exports.radioOptionRowClass = radioOptionRowClass;
3739
+ exports.rowActionsBaseClass = rowActionsBaseClass;
3740
+ exports.rowActionsDestructiveClass = rowActionsDestructiveClass;
3687
3741
  exports.selectBaseClass = selectBaseClass;
3688
3742
  exports.selectSizeClass = selectSizeClass;
3689
3743
  exports.selectVariantClass = selectVariantClass;