@stella-source/stellasource-dsl 0.1.6 → 0.2.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.
- package/dist/cjs/index.js +4545 -105
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/cjs/types/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/cjs/types/components/IconButton/types.d.ts +4 -1
- package/dist/cjs/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/cjs/types/components/Pagination/Pagination.stories.d.ts +13 -0
- package/dist/cjs/types/components/Pagination/styles.d.ts +14 -0
- package/dist/cjs/types/components/Pagination/types.d.ts +12 -0
- package/dist/cjs/types/components/StellaButton/StellaButton.d.ts +1 -1
- package/dist/cjs/types/components/StellaButton/StellaButton.stories.d.ts +1 -1
- package/dist/cjs/types/components/StellaButton/types.d.ts +1 -0
- package/dist/cjs/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/cjs/types/components/Sync/Sync.d.ts +4 -0
- package/dist/cjs/types/components/Sync/Sync.stories.d.ts +20 -0
- package/dist/cjs/types/components/Sync/styles.d.ts +7 -0
- package/dist/cjs/types/components/Sync/types.d.ts +8 -0
- package/dist/cjs/types/components/Table/Table.d.ts +4 -0
- package/dist/cjs/types/components/Table/Table.stories.d.ts +23 -0
- package/dist/cjs/types/components/Table/TableComponents/IndeterminateCheckbox.d.ts +8 -0
- package/dist/cjs/types/components/Table/TableComponents/RowOptions.d.ts +12 -0
- package/dist/cjs/types/components/Table/TableComponents/TableHeaderCell.d.ts +18 -0
- package/dist/cjs/types/components/Table/TableModule.d.ts +6 -0
- package/dist/cjs/types/components/Table/styles.d.ts +44 -0
- package/dist/cjs/types/components/Table/types.d.ts +50 -0
- package/dist/cjs/types/components/TableUnitsAndTotals/TableUnitsAndTotals.d.ts +4 -0
- package/dist/cjs/types/components/TableUnitsAndTotals/TableUnitsAndTotals.stories.d.ts +6 -0
- package/dist/cjs/types/components/TableUnitsAndTotals/styles.d.ts +7 -0
- package/dist/cjs/types/components/TableUnitsAndTotals/types.d.ts +32 -0
- package/dist/cjs/types/components/TextField/PasswordInput/styles.d.ts +1 -1
- package/dist/cjs/types/index.d.ts +5 -1
- package/dist/cjs/types/shared/utils/dateHelpers.d.ts +3 -0
- package/dist/cjs/types/shared/utils/numberHelpers.d.ts +1 -0
- package/dist/cjs/types/shared/utils/testing.d.ts +1 -1
- package/dist/esm/index.esm.js +4987 -551
- package/dist/esm/index.esm.js.map +1 -1
- package/dist/esm/styles.css +1 -1
- package/dist/esm/types/components/IconButton/IconButton.d.ts +1 -1
- package/dist/esm/types/components/IconButton/IconButton.stories.d.ts +1 -1
- package/dist/esm/types/components/IconButton/types.d.ts +4 -1
- package/dist/esm/types/components/Pagination/Pagination.d.ts +4 -0
- package/dist/esm/types/components/Pagination/Pagination.stories.d.ts +13 -0
- package/dist/esm/types/components/Pagination/styles.d.ts +14 -0
- package/dist/esm/types/components/Pagination/types.d.ts +12 -0
- package/dist/esm/types/components/StellaButton/StellaButton.d.ts +1 -1
- package/dist/esm/types/components/StellaButton/StellaButton.stories.d.ts +1 -1
- package/dist/esm/types/components/StellaButton/types.d.ts +1 -0
- package/dist/esm/types/components/StellaIcon/types.d.ts +1 -1
- package/dist/esm/types/components/Sync/Sync.d.ts +4 -0
- package/dist/esm/types/components/Sync/Sync.stories.d.ts +20 -0
- package/dist/esm/types/components/Sync/styles.d.ts +7 -0
- package/dist/esm/types/components/Sync/types.d.ts +8 -0
- package/dist/esm/types/components/Table/Table.d.ts +4 -0
- package/dist/esm/types/components/Table/Table.stories.d.ts +23 -0
- package/dist/esm/types/components/Table/TableComponents/IndeterminateCheckbox.d.ts +8 -0
- package/dist/esm/types/components/Table/TableComponents/RowOptions.d.ts +12 -0
- package/dist/esm/types/components/Table/TableComponents/TableHeaderCell.d.ts +18 -0
- package/dist/esm/types/components/Table/TableModule.d.ts +6 -0
- package/dist/esm/types/components/Table/styles.d.ts +44 -0
- package/dist/esm/types/components/Table/types.d.ts +50 -0
- package/dist/esm/types/components/TableUnitsAndTotals/TableUnitsAndTotals.d.ts +4 -0
- package/dist/esm/types/components/TableUnitsAndTotals/TableUnitsAndTotals.stories.d.ts +6 -0
- package/dist/esm/types/components/TableUnitsAndTotals/styles.d.ts +7 -0
- package/dist/esm/types/components/TableUnitsAndTotals/types.d.ts +32 -0
- package/dist/esm/types/components/TextField/PasswordInput/styles.d.ts +1 -1
- package/dist/esm/types/index.d.ts +5 -1
- package/dist/esm/types/shared/utils/dateHelpers.d.ts +3 -0
- package/dist/esm/types/shared/utils/numberHelpers.d.ts +1 -0
- package/dist/esm/types/shared/utils/testing.d.ts +1 -1
- package/dist/index.d.ts +111 -5
- package/package.json +14 -9
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React$1, { HTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { TooltipProps as TooltipProps$1 } from 'antd';
|
|
3
|
+
import { ColumnDef, ColumnFiltersState, Row } from '@tanstack/react-table';
|
|
3
4
|
|
|
4
5
|
interface LabelProps {
|
|
5
6
|
id: string;
|
|
@@ -47,10 +48,11 @@ interface StellaButtonProps {
|
|
|
47
48
|
disabled?: boolean;
|
|
48
49
|
preventDefault?: boolean;
|
|
49
50
|
variant?: `${StellaButtonVariant}`;
|
|
51
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
50
52
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
declare const StellaButton:
|
|
55
|
+
declare const StellaButton: React$1.ForwardRefExoticComponent<Omit<StellaButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
54
56
|
|
|
55
57
|
interface LoaderProps {
|
|
56
58
|
size?: number;
|
|
@@ -94,7 +96,7 @@ interface TooltipProps {
|
|
|
94
96
|
|
|
95
97
|
declare const Tooltip: ({ title, placement, type, ariaLabel, iconSize, htmlProps, className, id, }: TooltipProps) => React$1.JSX.Element;
|
|
96
98
|
|
|
97
|
-
type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash";
|
|
99
|
+
type StellaIconDefinition = "search" | "required" | "help" | "info" | "kebab-menu" | "error" | "warning" | "filter" | "sort" | "close" | "add" | "stella-logo" | "chevron-right" | "chevron-down" | "caret-right" | "caret-down" | "success" | "in-progress" | "complete" | "calendar" | "unlocked" | "locked" | "settings" | "preferences" | "account-settings" | "user" | "company-details" | "collapse" | "expand" | "star-filled" | "star-outline" | "dashboard" | "shopping-cart" | "calculator" | "pricing-strategies" | "stella-finance" | "resource-center" | "line-item-pricing" | "basket-pricing" | "paperclip" | "thumbs-up" | "thumbs-down" | "send" | "palette" | "eye" | "eye-slash" | "sync" | "chevron-left";
|
|
98
100
|
interface StellaIconProps {
|
|
99
101
|
iconName: StellaIconDefinition;
|
|
100
102
|
size?: number;
|
|
@@ -110,16 +112,19 @@ interface IconButtonProps {
|
|
|
110
112
|
iconName: `${StellaIconDefinition}`;
|
|
111
113
|
ariaLabel: string;
|
|
112
114
|
size?: number;
|
|
113
|
-
onClick: () => void;
|
|
115
|
+
onClick: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
114
116
|
id?: string;
|
|
115
117
|
className?: string;
|
|
116
118
|
isLoading?: boolean;
|
|
117
119
|
disabled?: boolean;
|
|
120
|
+
ref?: React.Ref<HTMLButtonElement>;
|
|
121
|
+
preventDefault?: boolean;
|
|
122
|
+
dataTestId?: string;
|
|
118
123
|
variant?: `${StellaButtonVariant}`;
|
|
119
124
|
htmlProps?: HTMLAttributes<HTMLButtonElement>;
|
|
120
125
|
}
|
|
121
126
|
|
|
122
|
-
declare const IconButton:
|
|
127
|
+
declare const IconButton: React$1.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
123
128
|
|
|
124
129
|
declare enum TextFieldAlignments {
|
|
125
130
|
LEFT = "left",
|
|
@@ -231,6 +236,107 @@ interface NumberInputProps {
|
|
|
231
236
|
|
|
232
237
|
declare const NumberInput: ({ id, className, htmlProps, leftCategory, rightCategory, label, onChange, onBlur, onFocus, value, isRequired, maxLength, tooltipText, helperText, endIcon, placeholder, textAlign, isTruncated, helperTextAffectLayout, hideLabel, disabled, isLoading, hasError, thousandSeparator, decimalPlaces, allowNegativeNumbers, ariaDescribedBy, }: NumberInputProps) => React$1.JSX.Element;
|
|
233
238
|
|
|
239
|
+
declare enum TableVariant {
|
|
240
|
+
PRIMARY = "Primary",
|
|
241
|
+
SECONDARY = "Secondary"
|
|
242
|
+
}
|
|
243
|
+
interface PaginationDetails {
|
|
244
|
+
startingPage: number;
|
|
245
|
+
totalRows: number;
|
|
246
|
+
rowsPerPage?: number;
|
|
247
|
+
}
|
|
248
|
+
interface TableProps<T> {
|
|
249
|
+
columns: ColumnDef<T, any>[];
|
|
250
|
+
data: T[];
|
|
251
|
+
isLoading?: boolean;
|
|
252
|
+
serverSide?: boolean;
|
|
253
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
254
|
+
onSortChange?: (sort: {
|
|
255
|
+
id: string;
|
|
256
|
+
desc: boolean;
|
|
257
|
+
}[]) => void;
|
|
258
|
+
onFilterChange?: (filters: ColumnFiltersState) => void;
|
|
259
|
+
onRowSelect?: (rows: T[]) => void;
|
|
260
|
+
showSelection?: boolean;
|
|
261
|
+
showRowOptions?: boolean;
|
|
262
|
+
showPagination?: boolean;
|
|
263
|
+
variant?: `${TableVariant}`;
|
|
264
|
+
selectionMenuItems?: {
|
|
265
|
+
label: string;
|
|
266
|
+
onClick: (row: Row<T>) => void;
|
|
267
|
+
conditional?: () => boolean;
|
|
268
|
+
}[];
|
|
269
|
+
dataTestId?: string;
|
|
270
|
+
dataAuto?: string;
|
|
271
|
+
id?: string;
|
|
272
|
+
className?: string;
|
|
273
|
+
htmlProps?: HTMLAttributes<HTMLTableElement>;
|
|
274
|
+
paginationDetails?: PaginationDetails;
|
|
275
|
+
rowStatuses?: Record<number | string, RowStatus>;
|
|
276
|
+
}
|
|
277
|
+
type RowStatus = "action-pending" | "completed";
|
|
278
|
+
|
|
279
|
+
declare function Table<T>({ columns, data, isLoading, serverSide, onPageChange, onSortChange, onFilterChange, onRowSelect, rowStatuses, showSelection, showRowOptions, showPagination, variant, paginationDetails, selectionMenuItems, dataAuto, dataTestId, id, className, htmlProps, }: TableProps<T>): React$1.JSX.Element;
|
|
280
|
+
|
|
281
|
+
interface PaginationProps {
|
|
282
|
+
id?: string;
|
|
283
|
+
className?: string;
|
|
284
|
+
htmlProps?: HTMLAttributes<HTMLElement>;
|
|
285
|
+
isLoading?: boolean;
|
|
286
|
+
rowsPerPage?: number;
|
|
287
|
+
ariaLabel?: string;
|
|
288
|
+
totalRows: number;
|
|
289
|
+
onPageChange?: (page: number, pageSize: number) => void;
|
|
290
|
+
startingPage?: number;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
declare const Pagination: ({ isLoading, rowsPerPage, totalRows, ariaLabel, onPageChange, startingPage, id, className, htmlProps, }: PaginationProps) => React$1.JSX.Element;
|
|
294
|
+
|
|
295
|
+
interface SyncProps {
|
|
296
|
+
id: string;
|
|
297
|
+
className?: string;
|
|
298
|
+
onClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>, time?: string) => void;
|
|
299
|
+
dataTestId?: string;
|
|
300
|
+
showTime?: boolean;
|
|
301
|
+
labelPosition?: "right" | "left";
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare const Sync: ({ dataTestId, onClick, className, id, showTime, labelPosition, }: SyncProps) => React$1.JSX.Element;
|
|
305
|
+
|
|
306
|
+
declare enum QuoteVariants {
|
|
307
|
+
TOTAL_PRICE = "total-price",
|
|
308
|
+
TOTAL_WEIGHT = "total-weight"
|
|
309
|
+
}
|
|
310
|
+
declare enum QuoteCategory {
|
|
311
|
+
ITEM = "/item",
|
|
312
|
+
HOUR = "/hr",
|
|
313
|
+
CWT = "CWT",
|
|
314
|
+
LBS = "lbs",
|
|
315
|
+
KG = "kg",
|
|
316
|
+
TON = "ton"
|
|
317
|
+
}
|
|
318
|
+
interface TableUnitsAndTotalsProps {
|
|
319
|
+
id?: string;
|
|
320
|
+
className?: string;
|
|
321
|
+
value: number;
|
|
322
|
+
subValue?: number;
|
|
323
|
+
rightCategory?: `${QuoteCategory}`;
|
|
324
|
+
}
|
|
325
|
+
interface TotalPriceProps {
|
|
326
|
+
variant: QuoteVariants.TOTAL_PRICE;
|
|
327
|
+
leftCategory?: `${TableUnitsAndTotalsLeftCategory}`;
|
|
328
|
+
}
|
|
329
|
+
interface TotalWeightProps {
|
|
330
|
+
variant: QuoteVariants.TOTAL_WEIGHT;
|
|
331
|
+
leftCategory?: never;
|
|
332
|
+
}
|
|
333
|
+
type TableUnitsAndTotals$1 = TableUnitsAndTotalsProps & (TotalPriceProps | TotalWeightProps);
|
|
334
|
+
declare enum TableUnitsAndTotalsLeftCategory {
|
|
335
|
+
US_CURRENCY = "$"
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
declare const TableUnitsAndTotals: ({ id, className, value, subValue, variant, leftCategory, rightCategory, }: TableUnitsAndTotals$1) => React$1.JSX.Element;
|
|
339
|
+
|
|
234
340
|
declare const Styles: {
|
|
235
341
|
color: {
|
|
236
342
|
white: string;
|
|
@@ -292,5 +398,5 @@ declare const Styles: {
|
|
|
292
398
|
};
|
|
293
399
|
};
|
|
294
400
|
|
|
295
|
-
export { HelperText, IconButton, Label, Loader, NumberInput, PasswordInput, StellaButton, StellaButtonVariant, StellaIcon, Styles, TextInput, Tooltip };
|
|
401
|
+
export { HelperText, IconButton, Label, Loader, NumberInput, Pagination, PasswordInput, StellaButton, StellaButtonVariant, StellaIcon, Styles, Sync, Table, TableUnitsAndTotals, TextInput, Tooltip };
|
|
296
402
|
export type { StellaIconDefinition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stella-source/stellasource-dsl",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Design System owned and operated by Stella Source.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -16,11 +16,17 @@
|
|
|
16
16
|
"test:coverage": "vitest run --coverage",
|
|
17
17
|
"start": "storybook dev -p 6006",
|
|
18
18
|
"build": "storybook build",
|
|
19
|
-
"package": "rollup -c"
|
|
19
|
+
"package": "rollup -c",
|
|
20
|
+
"ngrok": "ngrok http 6006"
|
|
20
21
|
},
|
|
21
22
|
"keywords": [],
|
|
22
23
|
"author": "",
|
|
23
24
|
"license": "ISC",
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"react": "^18 || ^19",
|
|
27
|
+
"react-dom": "^18 || ^19",
|
|
28
|
+
"styled-components": "^6.1.11"
|
|
29
|
+
},
|
|
24
30
|
"devDependencies": {
|
|
25
31
|
"@rollup/plugin-commonjs": "^26.0.1",
|
|
26
32
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
@@ -32,7 +38,10 @@
|
|
|
32
38
|
"@storybook/test": "^8.4.2",
|
|
33
39
|
"@testing-library/dom": "^10.1.0",
|
|
34
40
|
"@testing-library/jest-dom": "^6.4.6",
|
|
41
|
+
"@testing-library/react": "^16.0.0",
|
|
35
42
|
"@types/node": "^24.0.10",
|
|
43
|
+
"@types/react": "^19.0.1",
|
|
44
|
+
"@types/react-dom": "^19.2.2",
|
|
36
45
|
"@vitest/coverage-v8": "^1.6.0",
|
|
37
46
|
"jsdom": "^24.1.0",
|
|
38
47
|
"postcss": "^8.4.38",
|
|
@@ -41,22 +50,18 @@
|
|
|
41
50
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
42
51
|
"rollup-plugin-postcss": "^4.0.2",
|
|
43
52
|
"storybook": "^8.4.2",
|
|
53
|
+
"styled-components": "^6.1.11",
|
|
44
54
|
"typescript": "^5.4.5",
|
|
45
|
-
"
|
|
46
|
-
},
|
|
47
|
-
"peerDependencies": {
|
|
48
|
-
"styled-components": "^6.1.11"
|
|
55
|
+
"vitest": "^1.6.0"
|
|
49
56
|
},
|
|
50
57
|
"dependencies": {
|
|
51
58
|
"@phosphor-icons/react": "^2.1.7",
|
|
52
59
|
"@storybook/addon-docs": "^8.4.7",
|
|
53
60
|
"@storybook/manager-api": "^8.4.2",
|
|
54
61
|
"@tanstack/react-table": "^8.20.5",
|
|
55
|
-
"@testing-library/react": "^16.0.0",
|
|
56
62
|
"@vitejs/plugin-react": "^4.3.1",
|
|
57
63
|
"antd": "^5.20.0",
|
|
58
64
|
"tslib": "^2.6.3",
|
|
59
|
-
"vite-plugin-svgr": "^4.2.0"
|
|
60
|
-
"vitest": "^1.6.0"
|
|
65
|
+
"vite-plugin-svgr": "^4.2.0"
|
|
61
66
|
}
|
|
62
67
|
}
|