cleanplate 0.3.11 → 0.3.13
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/components/modal/Modal.d.ts.map +1 -1
- package/dist/components/table/Table.d.ts +35 -9
- package/dist/components/table/Table.d.ts.map +1 -1
- package/dist/components/table/index.d.ts +1 -1
- package/dist/components/table/index.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.css +1 -1
- package/dist/index.es.js +4 -4
- package/dist/index.js +4 -4
- package/dist/stories/table/table-arg-types.d.ts +5 -0
- package/dist/stories/table/table-arg-types.d.ts.map +1 -0
- package/docs/Modal.md +3 -3
- package/docs/Table.md +28 -11
- package/llms.txt +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ArgTypes } from "@storybook/types";
|
|
2
|
+
/** Storybook argTypes override — docgen shows "union" for TableMobileColumns | null. */
|
|
3
|
+
export declare const tableMobileColumnsArgType: ArgTypes[string];
|
|
4
|
+
export declare const tableDocsArgTypes: ArgTypes;
|
|
5
|
+
//# sourceMappingURL=table-arg-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-arg-types.d.ts","sourceRoot":"","sources":["../../../src/stories/table/table-arg-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAejD,wFAAwF;AACxF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAWtD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,QAE/B,CAAC"}
|
package/docs/Modal.md
CHANGED
|
@@ -137,10 +137,10 @@ const App = () => {
|
|
|
137
137
|
|
|
138
138
|
## Behavior Notes
|
|
139
139
|
|
|
140
|
-
- **Rendering:**
|
|
140
|
+
- **Rendering:** The modal mounts when `isOpen` is true and unmounts shortly after close so the exit transition can finish.
|
|
141
141
|
- **Close:** onClose is called when the user clicks the X button (if showCloseButton), the overlay (if closeOnOverlayClick), or Escape (if closeOnEscape). Footer buttons do not auto-close; call onClose in their handlers if desired.
|
|
142
|
-
- **Body scroll:**
|
|
143
|
-
- **Focus:**
|
|
142
|
+
- **Body scroll:** Body scroll is locked while open and restored when dismissed.
|
|
143
|
+
- **Focus:** Focus is trapped while open and returned to the previously focused element on close.
|
|
144
144
|
- **ARIA:** The overlay has `role="dialog"`, `aria-modal="true"`, and `aria-labelledby` pointing to the title when present.
|
|
145
145
|
- **Spacing:** `margin` accepts a full class string (e.g. "m-0") or an array of spacing suffixes; the component uses `getSpacingClass` with prefix `m-`.
|
|
146
146
|
|
package/docs/Table.md
CHANGED
|
@@ -61,16 +61,29 @@ interface TableColumn {
|
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
### TableMobileColumns
|
|
64
|
+
Extends static [MediaObject](./MediaObject.md) options (`margin`, `padding`, `descriptionLineClamp`, `className`, and other div attributes except `onClick`). Row-driven slots accept a **row key** or a **per-row resolver**.
|
|
65
|
+
|
|
64
66
|
```typescript
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
type TableMobileColumnKey = string;
|
|
68
|
+
|
|
69
|
+
type TableMobileColumnField<T = React.ReactNode> =
|
|
70
|
+
| TableMobileColumnKey
|
|
71
|
+
| ((row: TableRow) => T | undefined);
|
|
72
|
+
|
|
73
|
+
interface TableMobileColumns
|
|
74
|
+
extends Omit<
|
|
75
|
+
MediaObjectProps,
|
|
76
|
+
| "title" | "subtitle" | "description" | "meta" | "action"
|
|
77
|
+
| "mediaAvatar" | "mediaIcon" | "mediaImage" | "onClick"
|
|
78
|
+
> {
|
|
79
|
+
title: TableMobileColumnKey; // required row key
|
|
80
|
+
subtitle?: TableMobileColumnField;
|
|
81
|
+
description?: TableMobileColumnField;
|
|
82
|
+
meta?: TableMobileColumnField;
|
|
83
|
+
mediaAvatar?: TableMobileColumnKey;
|
|
84
|
+
mediaIcon?: TableMobileColumnField<string>; // static icon, row key, or resolver
|
|
85
|
+
mediaImage?: TableMobileColumnField<string>; // static URL, row key, or resolver
|
|
86
|
+
action?: (row: TableRow) => React.ReactNode;
|
|
74
87
|
}
|
|
75
88
|
```
|
|
76
89
|
|
|
@@ -163,8 +176,12 @@ const columns = [
|
|
|
163
176
|
data={data}
|
|
164
177
|
mobileColumns={{
|
|
165
178
|
title: "name",
|
|
179
|
+
subtitle: "role",
|
|
166
180
|
description: "email",
|
|
167
|
-
|
|
181
|
+
meta: "status",
|
|
182
|
+
mediaAvatar: "name",
|
|
183
|
+
descriptionLineClamp: 2,
|
|
184
|
+
action: (row) => <Badge label={String(row.status)} variant="success" />,
|
|
168
185
|
}}
|
|
169
186
|
/>
|
|
170
187
|
```
|
|
@@ -183,7 +200,7 @@ const columns = [
|
|
|
183
200
|
|
|
184
201
|
- **Required:** `columns` and `data` are required. Each column must have `id` and `title`; row keys should match `id` for default cell display.
|
|
185
202
|
- **Pagination:** Built-in Pagination is shown when `totalItems` > 0 and `hidePagination` is false. Pass `onPageChange` and optionally `onRowsPerPageChange`; keep `currentPage` and `rowsPerPage` in parent state.
|
|
186
|
-
- **Mobile:** When viewport width < 768px and `mobileColumns` is set,
|
|
203
|
+
- **Mobile:** When viewport width < 768px and `mobileColumns` is set, each row renders as a `MediaObject`. Map row keys to `title`, `subtitle`, `description`, `meta`, and media fields, or use resolvers / `action` for custom per-row UI. Static MediaObject props (`descriptionLineClamp`, `margin`, `padding`, etc.) pass through unchanged.
|
|
187
204
|
- **customRender:** Receives `(rowData, column)` and returns a React node; use for badges, buttons, or any custom cell content.
|
|
188
205
|
- **Spacing:** `margin` uses the suffix API; the component adds the `m-` prefix via `getSpacingClass`.
|
|
189
206
|
|
package/llms.txt
CHANGED
|
@@ -152,7 +152,7 @@ All component documentation is located in the `docs/` folder. The following docu
|
|
|
152
152
|
- File: `docs/Table.md`
|
|
153
153
|
- Purpose: Displays structured data in a table with configurable columns, optional built-in pagination, and responsive mobile view (MediaObject cards when viewport < 768px and mobileColumns set).
|
|
154
154
|
- Key Features: columns (id, title, textAlign, widthPercentage, customRender), data (TableRow[]), variants (default, compact), mobileColumns, onRowClick, pagination props (totalItems, currentPage, onPageChange, etc.), hidePagination, margin (suffix API)
|
|
155
|
-
- Types: TableProps, TableColumn, TableRow, TableVariant, TableMargin, TableColumnTextAlign, TableMobileColumns, SpacingOption
|
|
155
|
+
- Types: TableProps, TableColumn, TableRow, TableVariant, TableMargin, TableColumnTextAlign, TableMobileColumns, TableMobileColumnKey, TableMobileColumnField, SpacingOption
|
|
156
156
|
- Related Components: Pagination (built-in), MediaObject (mobile view), Typography, Container, Badge (often in customRender)
|
|
157
157
|
|
|
158
158
|
### Badge Component
|