@nimbus-ds/table 2.0.0 → 2.0.1
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/CHANGELOG.md +6 -4
- package/dist/CHANGELOG.md +57 -0
- package/dist/README.md +41 -0
- package/dist/index.d.ts +58 -11
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
The Table component allows us to organize data with a tabular structure in a table.
|
|
4
4
|
|
|
5
|
+
## 2025-03-18 `2.0.1`
|
|
6
|
+
|
|
7
|
+
### 💡 Others
|
|
8
|
+
|
|
9
|
+
- Rebuild after build process changes to add support for modular imports and Server Components. ([#276](https://github.com/TiendaNube/nimbus-design-system/pull/276) by [@joacotornello](https://github.com/joacotornello))
|
|
10
|
+
|
|
5
11
|
## 2023-03-13 `2.0.0`
|
|
6
12
|
|
|
7
13
|
### 🛠 Breaking changes
|
|
@@ -37,10 +43,6 @@ The Table component allows us to organize data with a tabular structure in a tab
|
|
|
37
43
|
|
|
38
44
|
## 2023-01-09 `1.0.0`
|
|
39
45
|
|
|
40
|
-
### 📚 3rd party library updates
|
|
41
|
-
|
|
42
|
-
- Added `webpack@5.74.0`. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
43
|
-
|
|
44
46
|
### 🎉 New features
|
|
45
47
|
|
|
46
48
|
- Added property `children` to the component. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The Table component allows us to organize data with a tabular structure in a table.
|
|
4
|
+
|
|
5
|
+
## 2025-03-18 `2.0.1`
|
|
6
|
+
|
|
7
|
+
### 💡 Others
|
|
8
|
+
|
|
9
|
+
- Rebuild after build process changes to add support for modular imports and Server Components. ([#276](https://github.com/TiendaNube/nimbus-design-system/pull/276) by [@joacotornello](https://github.com/joacotornello))
|
|
10
|
+
|
|
11
|
+
## 2023-03-13 `2.0.0`
|
|
12
|
+
|
|
13
|
+
### 🛠 Breaking changes
|
|
14
|
+
|
|
15
|
+
- Changed the `backgroundColor` properties to `neutral-background`, `neutral-surface`, `neutral-surfaceHighlight`, `primary-surface` and `primary-surfaceHighlight` on `Table.Cell` subcomponente. ([#110](https://github.com/TiendaNube/nimbus-design-system/pull/110) by [@juniorconquista](https://github.com/juniorconquista))
|
|
16
|
+
- Changed the `backgroundColor` properties to `neutral-background`, `neutral-surface`, `neutral-surfaceHighlight`, `primary-surface` and `primary-surfaceHighlight` on `Table.Row` subcomponente. ([#110](https://github.com/TiendaNube/nimbus-design-system/pull/110) by [@juniorconquista](https://github.com/juniorconquista))
|
|
17
|
+
|
|
18
|
+
### 💡 Others
|
|
19
|
+
|
|
20
|
+
- Refactored style classes to have more semantic names. ([#110](https://github.com/TiendaNube/nimbus-design-system/pull/110) by [@juniorconquista](https://github.com/juniorconquista))
|
|
21
|
+
|
|
22
|
+
## 2023-02-24 `1.2.1`
|
|
23
|
+
|
|
24
|
+
### 🎉 New features
|
|
25
|
+
|
|
26
|
+
- Added `as` prop on `Table.Cell` subcomponente API. ([#106](https://github.com/TiendaNube/nimbus-design-system/pull/106) by [@juanchigallego](https://github.com/juanchigallego))
|
|
27
|
+
|
|
28
|
+
### 🐛 Bug fixes
|
|
29
|
+
|
|
30
|
+
- Fixed a bug where `rest` condition selector sprinkle would not work. ([#106](https://github.com/TiendaNube/nimbus-design-system/pull/106) by [@juanchigallego](https://github.com/juanchigallego))
|
|
31
|
+
|
|
32
|
+
## 2023-02-23 `1.2.0`
|
|
33
|
+
|
|
34
|
+
### 🎉 New features
|
|
35
|
+
|
|
36
|
+
- Added server side-rendering support to component. ([#105](https://github.com/TiendaNube/nimbus-design-system/pull/105) by [@juniorconquista](https://github.com/juniorconquista))
|
|
37
|
+
|
|
38
|
+
## 2023-01-15 `1.1.0`
|
|
39
|
+
|
|
40
|
+
### 🎉 New features
|
|
41
|
+
|
|
42
|
+
- Add `backgroundColor` property to `Table.Row` subcomponent sprinkles. ([#94](https://github.com/TiendaNube/nimbus-design-system/pull/94) by [@juanchigallego](https://github.com/juanchigallego))
|
|
43
|
+
|
|
44
|
+
## 2023-01-09 `1.0.0`
|
|
45
|
+
|
|
46
|
+
### 🎉 New features
|
|
47
|
+
|
|
48
|
+
- Added property `children` to the component. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
49
|
+
- Added stories on the component. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
50
|
+
- Added `Table.Head` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
51
|
+
- Added property `children` to `Table.Head` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
52
|
+
- Added `Table.Body` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
53
|
+
- Added property `children` to `Table.Body` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
54
|
+
- Added `Table.Row` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
55
|
+
- Added properties `children`, `id` and `onClick` to `Table.Row` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
56
|
+
- Added `Table.Cell` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
|
57
|
+
- Added properties `children`, `padding`, `width`, `maxWidth` and `minWidth` to `Table.Cell` subcomponent. ([#72](https://github.com/TiendaNube/nimbus-design-system/pull/72) by [@juanchigallego](https://github.com/juanchigallego))
|
package/dist/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# `@nimbus-ds/table`
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@nimbus-ds/table)
|
|
4
|
+
|
|
5
|
+
The Table component allows us to organize data with a tabular structure in a table.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
$ yarn add @nimbus-ds/table
|
|
11
|
+
# or
|
|
12
|
+
$ npm install @nimbus-ds/table
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Component Anatomy
|
|
16
|
+
|
|
17
|
+
The component consists of a header with different styles, lines and columns.
|
|
18
|
+
|
|
19
|
+
## Guidelines
|
|
20
|
+
|
|
21
|
+
We use Table to organize information tabularly into rows and columns, using rows to sort entries similar in structure but different in information vertically and different types of data horizontally.
|
|
22
|
+
|
|
23
|
+
### Flexibility
|
|
24
|
+
|
|
25
|
+
Each cell has a children that can receive texts or other nimbus components, allowing a variety of custom configurations for each use case.
|
|
26
|
+
|
|
27
|
+
### Recommendation for use
|
|
28
|
+
|
|
29
|
+
- Organize a sales list
|
|
30
|
+
- Organize a list of products
|
|
31
|
+
- Arrange data of similar structure
|
|
32
|
+
|
|
33
|
+
### Related components
|
|
34
|
+
|
|
35
|
+
- Data list - Can be used when we need a different or more complex data structure, for example in mobile contexts.
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
View docs [here](https://nimbus.nuvemshop.com.br/documentation/atomic-components/table).
|
|
40
|
+
|
|
41
|
+
<img alt="Nimbus" style="margin-bottom: 30px;" src="https://tiendanube.github.io/design-system-nimbus/static/media/nimbus-logo.ab60bd79.png" height="30" />
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v7.
|
|
1
|
+
// Generated by dts-bundle-generator v7.2.0
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
5
5
|
|
|
6
|
-
export interface
|
|
6
|
+
export interface TableBodyProperties {
|
|
7
|
+
/**
|
|
8
|
+
* The content of the table body.
|
|
9
|
+
* @TJS-type React.ReactNode
|
|
10
|
+
*/
|
|
7
11
|
children: ReactNode;
|
|
8
12
|
}
|
|
13
|
+
export type TableBodyProps = TableBodyProperties & HTMLAttributes<HTMLTableSectionElement>;
|
|
9
14
|
declare const TableBody: React.FC<TableBodyProps>;
|
|
10
15
|
export interface Conditions<T> {
|
|
11
16
|
xs?: T;
|
|
@@ -37,30 +42,67 @@ export interface TableConditions<T> extends Conditions<T> {
|
|
|
37
42
|
hover?: T;
|
|
38
43
|
}
|
|
39
44
|
export interface TableSprinkle {
|
|
40
|
-
|
|
45
|
+
/**
|
|
46
|
+
* The width property specifies the width of a table's content area.
|
|
47
|
+
*/
|
|
41
48
|
width?: string | TableConditions<string>;
|
|
49
|
+
/**
|
|
50
|
+
* The maxWidth property specifies the maxWidth of a table's content area.
|
|
51
|
+
*/
|
|
42
52
|
maxWidth?: string | TableConditions<string>;
|
|
53
|
+
/**
|
|
54
|
+
* The minWidth property specifies the minWidth of a table's content area.
|
|
55
|
+
*/
|
|
43
56
|
minWidth?: string | TableConditions<string>;
|
|
57
|
+
/**
|
|
58
|
+
* The backgroundColor property sets the background color of the table.
|
|
59
|
+
*/
|
|
44
60
|
backgroundColor?: TableRowBackgroundColorProperties | TableConditions<TableRowBackgroundColorProperties>;
|
|
61
|
+
/**
|
|
62
|
+
* The padding properties are used to generate space around an table's content area.
|
|
63
|
+
*/
|
|
64
|
+
padding?: TablePaddingProperties | TableConditions<TablePaddingProperties>;
|
|
45
65
|
}
|
|
46
|
-
export
|
|
47
|
-
|
|
48
|
-
|
|
66
|
+
export interface TableCellProperties extends TableSprinkle {
|
|
67
|
+
/**
|
|
68
|
+
* The content of the table cell.
|
|
69
|
+
* @TJS-type React.ReactNode
|
|
70
|
+
*/
|
|
49
71
|
children: ReactNode;
|
|
50
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* Type of html tag to create for the table cell.
|
|
74
|
+
* @default td
|
|
75
|
+
*/
|
|
51
76
|
as?: "td" | "th";
|
|
52
77
|
}
|
|
78
|
+
export type TableCellProps = TableCellProperties & HTMLAttributes<HTMLTableCellElement>;
|
|
53
79
|
declare const TableCell: React.FC<TableCellProps>;
|
|
54
|
-
export interface
|
|
80
|
+
export interface TableHeadProperties {
|
|
81
|
+
/**
|
|
82
|
+
* The content of the table head.
|
|
83
|
+
* @TJS-type React.ReactNode
|
|
84
|
+
*/
|
|
55
85
|
children: ReactNode;
|
|
56
86
|
}
|
|
87
|
+
export type TableHeadProps = TableHeadProperties & HTMLAttributes<HTMLTableSectionElement>;
|
|
57
88
|
declare const TableHead: React.FC<TableHeadProps>;
|
|
58
|
-
export
|
|
59
|
-
|
|
89
|
+
export interface TableRowProperties extends TableSprinkle {
|
|
90
|
+
/**
|
|
91
|
+
* The content of the table row.
|
|
92
|
+
* @TJS-type React.ReactNode
|
|
93
|
+
*/
|
|
60
94
|
children: ReactNode;
|
|
95
|
+
/**
|
|
96
|
+
* The ID of the table row.
|
|
97
|
+
*/
|
|
61
98
|
id?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Function to be passed when clicking on the table row.
|
|
101
|
+
* @TJS-type () => void;
|
|
102
|
+
*/
|
|
62
103
|
onClick?: () => void;
|
|
63
104
|
}
|
|
105
|
+
export type TableRowProps = TableRowProperties & HTMLAttributes<HTMLTableRowElement>;
|
|
64
106
|
declare const TableRow: React.FC<TableRowProps>;
|
|
65
107
|
export interface TableComponents {
|
|
66
108
|
Body: typeof TableBody;
|
|
@@ -68,9 +110,14 @@ export interface TableComponents {
|
|
|
68
110
|
Head: typeof TableHead;
|
|
69
111
|
Row: typeof TableRow;
|
|
70
112
|
}
|
|
71
|
-
export interface
|
|
113
|
+
export interface TableProperties {
|
|
114
|
+
/**
|
|
115
|
+
* The content of the table.
|
|
116
|
+
* @TJS-type React.ReactNode
|
|
117
|
+
*/
|
|
72
118
|
children: ReactNode;
|
|
73
119
|
}
|
|
120
|
+
export type TableProps = TableProperties & HTMLAttributes<HTMLTableElement>;
|
|
74
121
|
export declare const Table: React.FC<TableProps> & TableComponents;
|
|
75
122
|
|
|
76
123
|
export {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/styles")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/styles"],t):"object"==typeof exports?exports["@nimbus-ds/table"]=t(require("react"),require("@nimbus-ds/styles")):e["@nimbus-ds/table"]=t(e.react,e["@nimbus-ds/styles"])}(global,((e,t)=>(()=>{"use strict";var r={160:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Table=void 0;const n=r(15).__importDefault(r(156)),o=r(990),a=r(612),l=({className:e,style:t,children:r,...a})=>n.default.createElement("table",{...a,className:o.table.classnames.container},r);t.Table=l,l.Body=a.TableBody,l.Cell=a.TableCell,l.Head=a.TableHead,l.Row=a.TableRow,l.displayName="Table",l.Body.displayName="Table.Body",l.Cell.displayName="Table.Cell",l.Head.displayName="Table.Head",l.Row.displayName="Table.Row"},269:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableBody=void 0;const n=r(15).__importDefault(r(156)),o=r(990);t.TableBody=({className:e,style:t,children:r,...a})=>n.default.createElement("tbody",{...a,className:o.table.classnames.container__body},r)},821:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableBody=void 0;const n=r(269);var o=r(269);Object.defineProperty(t,"TableBody",{enumerable:!0,get:function(){return o.TableBody}}),t.default=n.TableBody},101:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableCell=void 0;const n=r(15).__importDefault(r(156)),o=r(990);t.TableCell=({className:e,style:t,children:r,padding:a="small",as:l="td",...i})=>{const{className:c,style:u,otherProps:s}=o.table.sprinkle({...i,padding:a});return n.default.createElement(l,{...s,style:u,className:[o.table.classnames.container__cell,c].join(" ")},r)}},781:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableCell=void 0;const n=r(101);var o=r(101);Object.defineProperty(t,"TableCell",{enumerable:!0,get:function(){return o.TableCell}}),t.default=n.TableCell},240:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableHead=void 0;const n=r(15).__importDefault(r(156)),o=r(990);t.TableHead=({className:e,style:t,children:r,...a})=>n.default.createElement("thead",{...a,className:o.table.classnames.container__head},r)},585:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableHead=void 0;const n=r(240);var o=r(240);Object.defineProperty(t,"TableHead",{enumerable:!0,get:function(){return o.TableHead}}),t.default=n.TableHead},833:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableRow=void 0;const n=r(15).__importDefault(r(156)),o=r(990);t.TableRow=({className:e,style:t,children:r,id:a,onClick:l,backgroundColor:i={rest:"neutral-background",active:"primary-surface",hover:"neutral-surface"},...c})=>{const{className:u,style:s,otherProps:f}=o.table.sprinkle({...c,backgroundColor:i});return n.default.createElement("tr",{className:[o.table.classnames.container__row,u].join(" "),style:s,...f,id:a,onClick:l},r)}},810:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableRow=void 0;const n=r(833);var o=r(833);Object.defineProperty(t,"TableRow",{enumerable:!0,get:function(){return o.TableRow}}),t.default=n.TableRow},612:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(15);n.__exportStar(r(821),t),n.__exportStar(r(781),t),n.__exportStar(r(585),t),n.__exportStar(r(810),t)},15:(e,t,r)=>{r.r(t),r.d(t,{__assign:()=>a,__asyncDelegator:()=>O,__asyncGenerator:()=>w,__asyncValues:()=>j,__await:()=>h,__awaiter:()=>s,__classPrivateFieldGet:()=>S,__classPrivateFieldIn:()=>E,__classPrivateFieldSet:()=>C,__createBinding:()=>d,__decorate:()=>i,__exportStar:()=>y,__extends:()=>o,__generator:()=>f,__importDefault:()=>x,__importStar:()=>g,__makeTemplateObject:()=>T,__metadata:()=>u,__param:()=>c,__read:()=>p,__rest:()=>l,__spread:()=>_,__spreadArray:()=>m,__spreadArrays:()=>v,__values:()=>b});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function l(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){var o,a=arguments.length,l=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(l=(a<3?o(l):a>3?o(t,r,l):o(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function s(e,t,r,n){return new(r||(r=Promise))((function(o,a){function l(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((n=n.apply(e,t||[])).next())}))}function f(e,t){var r,n,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;l;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return l.label++,{value:a[1],done:!1};case 5:l.label++,n=a[1],a=[0];continue;case 7:a=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){l=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){l.label=a[1];break}if(6===a[0]&&l.label<o[1]){l.label=o[1],o=a;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(a);break}o[2]&&l.ops.pop(),l.trys.pop();continue}a=t.call(e,l)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}var d=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function y(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||d(t,e,r)}function b(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)l.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return l}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(p(arguments[t]));return e}function v(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],l=0,i=a.length;l<i;l++,o++)n[o]=a[l];return n}function m(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function h(e){return this instanceof h?(this.v=e,this):new h(e)}function w(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},l("next"),l("throw"),l("return"),n[Symbol.asyncIterator]=function(){return this},n;function l(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||i(e,t)}))})}function i(e,t){try{(r=o[e](t)).value instanceof h?Promise.resolve(r.value.v).then(c,u):s(a[0][2],r)}catch(e){s(a[0][3],e)}var r}function c(e){i("next",e)}function u(e){i("throw",e)}function s(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}}function O(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:h(e[n](t)),done:"return"===n}:o?o(t):t}:o}}function j(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=b(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function T(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var P=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function g(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&d(t,e,r);return P(t,e),t}function x(e){return e&&e.__esModule?e:{default:e}}function S(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function C(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function E(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}},990:e=>{e.exports=t},156:t=>{t.exports=e}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.Table=void 0;const t=o(160);var r=o(160);Object.defineProperty(e,"Table",{enumerable:!0,get:function(){return r.Table}}),e.default=t.Table})(),a})()));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("@nimbus-ds/styles")):"function"==typeof define&&define.amd?define(["react","@nimbus-ds/styles"],t):"object"==typeof exports?exports["@nimbus-ds/table"]=t(require("react"),require("@nimbus-ds/styles")):e["@nimbus-ds/table"]=t(e.react,e["@nimbus-ds/styles"])}(global,((e,t)=>(()=>{"use strict";var r={168:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Table=void 0;const n=r(769).__importDefault(r(155)),o=r(367),a=r(337),l=({className:e,style:t,children:r,...a})=>n.default.createElement("table",{...a,className:o.table.classnames.container},r);t.Table=l,l.Body=a.TableBody,l.Cell=a.TableCell,l.Head=a.TableHead,l.Row=a.TableRow,l.displayName="Table",l.Body.displayName="Table.Body",l.Cell.displayName="Table.Cell",l.Head.displayName="Table.Head",l.Row.displayName="Table.Row"},718:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableBody=void 0;const n=r(769).__importDefault(r(155)),o=r(367);t.TableBody=({className:e,style:t,children:r,...a})=>n.default.createElement("tbody",{...a,className:o.table.classnames.container__body},r)},878:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableBody=void 0;const n=r(718);var o=r(718);Object.defineProperty(t,"TableBody",{enumerable:!0,get:function(){return o.TableBody}}),t.default=n.TableBody},74:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableCell=void 0;const n=r(769).__importDefault(r(155)),o=r(367);t.TableCell=({className:e,style:t,children:r,padding:a="small",as:l="td",...i})=>{const{className:c,style:s,otherProps:u}=o.table.sprinkle({...i,padding:a});return n.default.createElement(l,{...u,style:s,className:[o.table.classnames.container__cell,c].join(" ")},r)}},670:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableCell=void 0;const n=r(74);var o=r(74);Object.defineProperty(t,"TableCell",{enumerable:!0,get:function(){return o.TableCell}}),t.default=n.TableCell},82:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableHead=void 0;const n=r(769).__importDefault(r(155)),o=r(367);t.TableHead=({className:e,style:t,children:r,...a})=>n.default.createElement("thead",{...a,className:o.table.classnames.container__head},r)},388:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableHead=void 0;const n=r(82);var o=r(82);Object.defineProperty(t,"TableHead",{enumerable:!0,get:function(){return o.TableHead}}),t.default=n.TableHead},680:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableRow=void 0;const n=r(769).__importDefault(r(155)),o=r(367);t.TableRow=({className:e,style:t,children:r,id:a,onClick:l,backgroundColor:i={rest:"neutral-background",active:"primary-surface",hover:"neutral-surface"},...c})=>{const{className:s,style:u,otherProps:f}=o.table.sprinkle({...c,backgroundColor:i});return n.default.createElement("tr",{className:[o.table.classnames.container__row,s].join(" "),style:u,...f,id:a,onClick:l},r)}},230:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TableRow=void 0;const n=r(680);var o=r(680);Object.defineProperty(t,"TableRow",{enumerable:!0,get:function(){return o.TableRow}}),t.default=n.TableRow},337:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0});const n=r(769);n.__exportStar(r(878),t),n.__exportStar(r(670),t),n.__exportStar(r(388),t),n.__exportStar(r(230),t)},367:e=>{e.exports=t},155:t=>{t.exports=e},769:(e,t,r)=>{r.r(t),r.d(t,{__addDisposableResource:()=>M,__assign:()=>a,__asyncDelegator:()=>P,__asyncGenerator:()=>T,__asyncValues:()=>S,__await:()=>j,__awaiter:()=>y,__classPrivateFieldGet:()=>k,__classPrivateFieldIn:()=>N,__classPrivateFieldSet:()=>D,__createBinding:()=>_,__decorate:()=>i,__disposeResources:()=>I,__esDecorate:()=>s,__exportStar:()=>v,__extends:()=>o,__generator:()=>b,__importDefault:()=>C,__importStar:()=>R,__makeTemplateObject:()=>x,__metadata:()=>p,__param:()=>c,__propKey:()=>f,__read:()=>h,__rest:()=>l,__runInitializers:()=>u,__setFunctionName:()=>d,__spread:()=>w,__spreadArray:()=>O,__spreadArrays:()=>g,__values:()=>m,default:()=>H});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function l(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function i(e,t,r,n){var o,a=arguments.length,l=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,r,n);else for(var i=e.length-1;i>=0;i--)(o=e[i])&&(l=(a<3?o(l):a>3?o(t,r,l):o(t,r))||l);return a>3&&l&&Object.defineProperty(t,r,l),l}function c(e,t){return function(r,n){t(r,n,e)}}function s(e,t,r,n,o,a){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var i,c=n.kind,s="getter"===c?"get":"setter"===c?"set":"value",u=!t&&e?n.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),d=!1,p=r.length-1;p>=0;p--){var y={};for(var b in n)y[b]="access"===b?{}:n[b];for(var b in n.access)y.access[b]=n.access[b];y.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");a.push(l(e||null))};var _=(0,r[p])("accessor"===c?{get:f.get,set:f.set}:f[s],y);if("accessor"===c){if(void 0===_)continue;if(null===_||"object"!=typeof _)throw new TypeError("Object expected");(i=l(_.get))&&(f.get=i),(i=l(_.set))&&(f.set=i),(i=l(_.init))&&o.unshift(i)}else(i=l(_))&&("field"===c?o.unshift(i):f[s]=i)}u&&Object.defineProperty(u,n.name,f),d=!0}function u(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function f(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function p(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function y(e,t,r,n){return new(r||(r=Promise))((function(o,a){function l(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(l,i)}c((n=n.apply(e,t||[])).next())}))}function b(e,t){var r,n,o,a,l={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(l=0)),l;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,n=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(!(o=l.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){l=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){l.label=i[1];break}if(6===i[0]&&l.label<o[1]){l.label=o[1],o=i;break}if(o&&l.label<o[2]){l.label=o[2],l.ops.push(i);break}o[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var _=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function v(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||_(t,e,r)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)l.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return l}function w(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function g(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var a=arguments[t],l=0,i=a.length;l<i;l++,o++)n[o]=a[l];return n}function O(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function j(e){return this instanceof j?(this.v=e,this):new j(e)}function T(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),a=[];return n={},l("next"),l("throw"),l("return"),n[Symbol.asyncIterator]=function(){return this},n;function l(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){a.push([e,t,r,n])>1||i(e,t)}))})}function i(e,t){try{(r=o[e](t)).value instanceof j?Promise.resolve(r.value.v).then(c,s):u(a[0][2],r)}catch(e){u(a[0][3],e)}var r}function c(e){i("next",e)}function s(e){i("throw",e)}function u(e,t){e(t),a.shift(),a.length&&i(a[0][0],a[0][1])}}function P(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:j(e[n](t)),done:!1}:o?o(t):t}:o}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=m(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function x(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var E=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function R(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&_(t,e,r);return E(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function D(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function N(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function M(e,t,r){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var B="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function I(e){function t(t){e.error=e.hasError?new B(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}const H={__extends:o,__assign:a,__rest:l,__decorate:i,__param:c,__metadata:p,__awaiter:y,__generator:b,__createBinding:_,__exportStar:v,__values:m,__read:h,__spread:w,__spreadArrays:g,__spreadArray:O,__await:j,__asyncGenerator:T,__asyncDelegator:P,__asyncValues:S,__makeTemplateObject:x,__importStar:R,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:D,__classPrivateFieldIn:N,__addDisposableResource:M,__disposeResources:I}}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var a=n[e]={exports:{}};return r[e](a,a.exports,o),a.exports}o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};return(()=>{var e=a;Object.defineProperty(e,"__esModule",{value:!0}),e.Table=void 0;const t=o(168);var r=o(168);Object.defineProperty(e,"Table",{enumerable:!0,get:function(){return r.Table}}),e.default=t.Table})(),a})()));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nimbus-ds/table",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
],
|
|
10
10
|
"sideEffects": false,
|
|
11
11
|
"scripts": {
|
|
12
|
-
"build": "webpack",
|
|
12
|
+
"build": "yarn g:webpack",
|
|
13
13
|
"clean": "rm -rf dist",
|
|
14
14
|
"version": "yarn version"
|
|
15
15
|
},
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"url": "https://github.com/TiendaNube/nimbus-design-system/issues"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"webpack": "^5.
|
|
29
|
+
"@nimbus-ds/webpack": "^1.5.0"
|
|
30
30
|
}
|
|
31
31
|
}
|