@xqmsg/ui-core 0.11.0 → 0.12.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/components/table/TableTypes.d.ts +0 -1
- package/dist/components/table/{loading → components/loading}/index.d.ts +0 -0
- package/dist/components/table/components/text/index.d.ts +9 -0
- package/dist/components/table/index.d.ts +2 -4
- package/dist/theme/components/table.d.ts +28 -0
- package/dist/ui-core.cjs.development.js +48 -19
- package/dist/ui-core.cjs.development.js.map +1 -1
- package/dist/ui-core.cjs.production.min.js +1 -1
- package/dist/ui-core.cjs.production.min.js.map +1 -1
- package/dist/ui-core.esm.js +50 -21
- package/dist/ui-core.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.stories.tsx +1 -1
- package/src/components/table/Table.stories.tsx +2 -8
- package/src/components/table/TableTypes.ts +0 -20
- package/src/components/table/{loading → components/loading}/index.tsx +6 -3
- package/src/components/table/components/text/index.tsx +23 -0
- package/src/components/table/index.tsx +4 -10
- package/src/theme/components/table.ts +34 -0
- package/src/theme/customXQChakraTheme.ts +2 -0
|
@@ -8,4 +8,3 @@ export declare type TableRow<K extends ReadonlyTableColumns> = {
|
|
|
8
8
|
[k in K[number]]: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export declare type TableBody<R extends ReadonlyTableColumns> = TableRow<R>[];
|
|
11
|
-
export declare type TableColorScheme = 'blue' | 'cyan' | 'gray' | 'green' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'yellow' | 'whiteAlpha' | 'blackAlpha' | 'linkedin' | 'facebook' | 'messenger' | 'whatsapp' | 'twitter' | 'telegram';
|
|
File without changes
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TableTextProps {
|
|
3
|
+
primaryText: string;
|
|
4
|
+
secondaryText?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A functional React component utilized to render the `TableText` component
|
|
8
|
+
*/
|
|
9
|
+
export declare const TableText: React.FC<TableTextProps>;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ReadonlyTableColumns, TableBody,
|
|
2
|
+
import { ReadonlyTableColumns, TableBody, TableColumns, TableHeaders } from './TableTypes';
|
|
3
3
|
export interface TableProps<T extends ReadonlyTableColumns> {
|
|
4
4
|
columns: TableColumns;
|
|
5
5
|
headers: TableHeaders<T>;
|
|
6
6
|
body: TableBody<T>;
|
|
7
7
|
loading?: boolean;
|
|
8
|
-
variant: 'simple' | 'striped' | 'unstyled';
|
|
9
|
-
colorScheme?: TableColorScheme;
|
|
10
8
|
borderTopRadius?: boolean;
|
|
11
9
|
loadMore?: () => void;
|
|
12
10
|
placeholder?: string;
|
|
@@ -14,4 +12,4 @@ export interface TableProps<T extends ReadonlyTableColumns> {
|
|
|
14
12
|
/**
|
|
15
13
|
* A React component utilized to render the `Table` component
|
|
16
14
|
*/
|
|
17
|
-
export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, placeholder, loading,
|
|
15
|
+
export declare function Table<T extends ReadonlyTableColumns>({ columns, headers, body, placeholder, loading, borderTopRadius, loadMore, }: TableProps<T>): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
parts: string[];
|
|
3
|
+
baseStyle: {
|
|
4
|
+
th: {
|
|
5
|
+
height: string;
|
|
6
|
+
width: string;
|
|
7
|
+
bg: string;
|
|
8
|
+
padding: string;
|
|
9
|
+
};
|
|
10
|
+
tr: {
|
|
11
|
+
fontSize: string;
|
|
12
|
+
display: string;
|
|
13
|
+
alignItems: string;
|
|
14
|
+
width: string;
|
|
15
|
+
height: string;
|
|
16
|
+
borderRadius: string;
|
|
17
|
+
_odd: {
|
|
18
|
+
background: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
td: {
|
|
22
|
+
padding: string;
|
|
23
|
+
borderRadius: string;
|
|
24
|
+
width: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export default _default;
|
|
@@ -1473,8 +1473,11 @@ var TableLoadingRows = function TableLoadingRows(_ref) {
|
|
|
1473
1473
|
"aria-label": "Fetch more rows",
|
|
1474
1474
|
icon: /*#__PURE__*/React__default.createElement(hi.HiOutlineRefresh, null),
|
|
1475
1475
|
fontSize: typography.fontSizes['3xl'],
|
|
1476
|
+
bg: "transparent",
|
|
1477
|
+
shadow: "none",
|
|
1478
|
+
color: colors.fill.action,
|
|
1476
1479
|
type: "button",
|
|
1477
|
-
variant: "
|
|
1480
|
+
variant: "outline",
|
|
1478
1481
|
onClick: onLoadMore
|
|
1479
1482
|
}));
|
|
1480
1483
|
};
|
|
@@ -1490,24 +1493,19 @@ function Table(_ref) {
|
|
|
1490
1493
|
_ref$placeholder = _ref.placeholder,
|
|
1491
1494
|
placeholder = _ref$placeholder === void 0 ? 'There is currently no available data' : _ref$placeholder,
|
|
1492
1495
|
loading = _ref.loading,
|
|
1493
|
-
_ref$variant = _ref.variant,
|
|
1494
|
-
variant = _ref$variant === void 0 ? 'simple' : _ref$variant,
|
|
1495
|
-
colorScheme = _ref.colorScheme,
|
|
1496
1496
|
_ref$borderTopRadius = _ref.borderTopRadius,
|
|
1497
1497
|
borderTopRadius = _ref$borderTopRadius === void 0 ? true : _ref$borderTopRadius,
|
|
1498
1498
|
loadMore = _ref.loadMore;
|
|
1499
1499
|
var columnsAsConst = generateTableColumnsAsConst(columns);
|
|
1500
1500
|
return /*#__PURE__*/React__default.createElement(react.TableContainer, {
|
|
1501
|
-
border: "
|
|
1502
|
-
borderColor: colors.fill.light.quaternary,
|
|
1501
|
+
border: "none",
|
|
1503
1502
|
overflowX: "auto",
|
|
1504
1503
|
bg: "white",
|
|
1505
1504
|
borderRadius: "md",
|
|
1506
1505
|
borderTopLeftRadius: borderTopRadius ? 'md' : 0,
|
|
1507
1506
|
borderTopRightRadius: borderTopRadius ? 'md' : 0
|
|
1508
1507
|
}, /*#__PURE__*/React__default.createElement(react.Table, {
|
|
1509
|
-
variant:
|
|
1510
|
-
colorScheme: colorScheme
|
|
1508
|
+
variant: "unstyled"
|
|
1511
1509
|
}, /*#__PURE__*/React__default.createElement(react.Thead, null, /*#__PURE__*/React__default.createElement(react.Tr, null, columnsAsConst.map(function (column) {
|
|
1512
1510
|
return (
|
|
1513
1511
|
/*#__PURE__*/
|
|
@@ -2365,7 +2363,37 @@ var Switch = {
|
|
|
2365
2363
|
defaultProps: defaultProps$7
|
|
2366
2364
|
};
|
|
2367
2365
|
|
|
2368
|
-
var parts$7 = ['
|
|
2366
|
+
var parts$7 = ['th', 'td', 'tr', 'body'];
|
|
2367
|
+
var baseStyle$c = {
|
|
2368
|
+
th: {
|
|
2369
|
+
height: 'fit-content',
|
|
2370
|
+
width: '100%',
|
|
2371
|
+
bg: colors.label.primary.dark,
|
|
2372
|
+
padding: '5px 8px !important'
|
|
2373
|
+
},
|
|
2374
|
+
tr: {
|
|
2375
|
+
fontSize: '13px',
|
|
2376
|
+
display: 'flex',
|
|
2377
|
+
alignItems: 'center',
|
|
2378
|
+
width: '100%',
|
|
2379
|
+
height: 'fit-content',
|
|
2380
|
+
borderRadius: 'md',
|
|
2381
|
+
_odd: {
|
|
2382
|
+
background: colors.fill.light.tertiary
|
|
2383
|
+
}
|
|
2384
|
+
},
|
|
2385
|
+
td: {
|
|
2386
|
+
padding: '5px 8px !important',
|
|
2387
|
+
borderRadius: 'md',
|
|
2388
|
+
width: '100%'
|
|
2389
|
+
}
|
|
2390
|
+
};
|
|
2391
|
+
var Table$1 = {
|
|
2392
|
+
parts: parts$7,
|
|
2393
|
+
baseStyle: baseStyle$c
|
|
2394
|
+
};
|
|
2395
|
+
|
|
2396
|
+
var parts$8 = ['root', 'tablist', 'tab', 'tabpanel', 'indicator'];
|
|
2369
2397
|
|
|
2370
2398
|
function baseStyleRoot(props) {
|
|
2371
2399
|
var orientation = props.orientation;
|
|
@@ -2405,7 +2433,7 @@ var baseStyleTabpanel = {
|
|
|
2405
2433
|
p: 4
|
|
2406
2434
|
};
|
|
2407
2435
|
|
|
2408
|
-
var baseStyle$
|
|
2436
|
+
var baseStyle$d = function baseStyle(props) {
|
|
2409
2437
|
return {
|
|
2410
2438
|
root: baseStyleRoot(props),
|
|
2411
2439
|
tab: baseStyleTab(props),
|
|
@@ -2599,14 +2627,14 @@ var defaultProps$8 = {
|
|
|
2599
2627
|
colorScheme: 'blue'
|
|
2600
2628
|
};
|
|
2601
2629
|
var Tabs = {
|
|
2602
|
-
parts: parts$
|
|
2603
|
-
baseStyle: baseStyle$
|
|
2630
|
+
parts: parts$8,
|
|
2631
|
+
baseStyle: baseStyle$d,
|
|
2604
2632
|
sizes: sizes$2,
|
|
2605
2633
|
variants: variants$8,
|
|
2606
2634
|
defaultProps: defaultProps$8
|
|
2607
2635
|
};
|
|
2608
2636
|
|
|
2609
|
-
var baseStyle$
|
|
2637
|
+
var baseStyle$e = /*#__PURE__*/_extends({}, Input$1.baseStyle.field, {
|
|
2610
2638
|
display: 'block',
|
|
2611
2639
|
paddingY: '8px',
|
|
2612
2640
|
height: '80px',
|
|
@@ -2617,12 +2645,12 @@ var defaultProps$9 = {
|
|
|
2617
2645
|
variant: 'default'
|
|
2618
2646
|
};
|
|
2619
2647
|
var Textarea = {
|
|
2620
|
-
baseStyle: baseStyle$
|
|
2648
|
+
baseStyle: baseStyle$e,
|
|
2621
2649
|
defaultProps: defaultProps$9
|
|
2622
2650
|
};
|
|
2623
2651
|
|
|
2624
2652
|
var defaultProps$a = react.Text.defaultProps;
|
|
2625
|
-
var baseStyle$
|
|
2653
|
+
var baseStyle$f = {
|
|
2626
2654
|
fontWeight: typography.fontWeights.normal,
|
|
2627
2655
|
fontFamily: typography.fonts.base,
|
|
2628
2656
|
fontSize: typography.fontSizes.sm,
|
|
@@ -2631,7 +2659,7 @@ var baseStyle$e = {
|
|
|
2631
2659
|
};
|
|
2632
2660
|
|
|
2633
2661
|
function variantHeader() {
|
|
2634
|
-
return _extends({}, baseStyle$
|
|
2662
|
+
return _extends({}, baseStyle$f, {
|
|
2635
2663
|
fontWeight: typography.fontWeights.bold,
|
|
2636
2664
|
fontSize: typography.fontSizes['3xl'],
|
|
2637
2665
|
lineHeight: typography.lineHeights[8],
|
|
@@ -2640,7 +2668,7 @@ function variantHeader() {
|
|
|
2640
2668
|
}
|
|
2641
2669
|
|
|
2642
2670
|
function variantSubheader() {
|
|
2643
|
-
return _extends({}, baseStyle$
|
|
2671
|
+
return _extends({}, baseStyle$f, {
|
|
2644
2672
|
fontWeight: typography.fontWeights.semibold,
|
|
2645
2673
|
fontSize: typography.fontSizes['lg'],
|
|
2646
2674
|
lineHeight: typography.lineHeights[5],
|
|
@@ -2649,7 +2677,7 @@ function variantSubheader() {
|
|
|
2649
2677
|
}
|
|
2650
2678
|
|
|
2651
2679
|
function variantParagraph() {
|
|
2652
|
-
return baseStyle$
|
|
2680
|
+
return baseStyle$f;
|
|
2653
2681
|
}
|
|
2654
2682
|
|
|
2655
2683
|
var variants$9 = {
|
|
@@ -2658,7 +2686,7 @@ var variants$9 = {
|
|
|
2658
2686
|
paragraph: variantParagraph
|
|
2659
2687
|
};
|
|
2660
2688
|
var Text$1 = {
|
|
2661
|
-
baseStyle: baseStyle$
|
|
2689
|
+
baseStyle: baseStyle$f,
|
|
2662
2690
|
variants: variants$9,
|
|
2663
2691
|
defaultProps: /*#__PURE__*/_extends({}, defaultProps$a, {
|
|
2664
2692
|
variant: variants$9.paragraph
|
|
@@ -2703,6 +2731,7 @@ var customXQChakraTheme = /*#__PURE__*/react.extendTheme( /*#__PURE__*/_extends(
|
|
|
2703
2731
|
Modal: Modal,
|
|
2704
2732
|
Select: Select,
|
|
2705
2733
|
Switch: Switch,
|
|
2734
|
+
Table: Table$1,
|
|
2706
2735
|
Tabs: Tabs,
|
|
2707
2736
|
Textarea: Textarea,
|
|
2708
2737
|
Text: Text$1
|