@atom-learning/components 2.16.0 → 2.18.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/CHANGELOG.md +13 -7
- package/dist/components/badge/Badge.js +1 -1
- package/dist/components/data-table/DataTableContext.d.ts +4 -2
- package/dist/components/data-table/DataTableContext.js +1 -1
- package/dist/components/divider/Divider.js +1 -1
- package/dist/components/stack-content/StackContent.js +1 -1
- package/dist/docgen.json +1 -1
- package/dist/docs/Badge.mdx +20 -3
- package/dist/docs/DataTable.mdx +2 -2
- package/dist/index.cjs.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
# [2.
|
|
1
|
+
# [2.18.0](https://github.com/Atom-Learning/components/compare/v2.17.0...v2.18.0) (2022-11-30)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update README ([3ae762d](https://github.com/Atom-Learning/components/commit/3ae762dde4d9decba395bb3e278c00fb404a8d81))
|
|
2
7
|
|
|
3
8
|
|
|
4
9
|
### Features
|
|
5
10
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* add experimental flag to ColorScheme component ([bb8d223](https://github.com/Atom-Learning/components/commit/bb8d223889de948d5502f8bd2627c154dd7e20b1))
|
|
12
|
+
* change foreground colour to one from slate gradient and use white directly ([cbf8aac](https://github.com/Atom-Learning/components/commit/cbf8aacd903f20a4efe9dda2d29b906056d9d06f))
|
|
13
|
+
* changes based on PR comments ([d58d803](https://github.com/Atom-Learning/components/commit/d58d80399fe55ec6c52c15b1fb52e53173e7b97f))
|
|
14
|
+
* ColorScheme alpha version ([bc204cb](https://github.com/Atom-Learning/components/commit/bc204cb9c6ac4163c8bfab552d5f4daa769610fa))
|
|
15
|
+
* remove testing lib requirement ([c9d68b9](https://github.com/Atom-Learning/components/commit/c9d68b95a8fbd54ee36cc23a532ce6465507afdc))
|
|
16
|
+
* rename tonal vars to base to match property of ColorScheme component ([6253323](https://github.com/Atom-Learning/components/commit/62533232a5d91b84a7e6d996fa9dd02ce78e8f5d))
|
|
17
|
+
* space out all children of StackContent ([004848e](https://github.com/Atom-Learning/components/commit/004848e6f602579cadb3cbe741ab61fca5240688))
|
|
12
18
|
|
|
13
19
|
# [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
|
|
14
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as t from"react";import{styled as m}from"../../stitches.js";import{Box as l}from"../box/Box.js";import{Flex as a}from"../flex/Flex.js";import{Icon as d}from"../icon/Icon.js";const c=m(a,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),i=({theme:r="info",size:o="sm",children:n,...s})=>t.createElement(c,{role:"status",theme:r,size:o,...s},t.Children.map(n,e=>{if(typeof e=="string")return t.createElement(l,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},e);if(t.isValidElement(e)&&e.type===d)return t.cloneElement(e,{size:"sm",css:{...e.props.css,flexShrink:0}})}));i.displayName="Badge";export{i as Badge};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { Table } from '@tanstack/react-table';
|
|
2
|
+
import type { VisibilityTableState, ColumnOrderTableState, ColumnPinningTableState, FiltersTableState, SortingTableState, ExpandedTableState, GroupingTableState, ColumnSizingTableState, PaginationTableState, RowSelectionTableState, Table } from '@tanstack/react-table';
|
|
3
3
|
declare type DataTableContextType<T = unknown> = Table<T> & {
|
|
4
4
|
setIsSortable: React.Dispatch<React.SetStateAction<boolean>>;
|
|
5
5
|
applyPagination: () => void;
|
|
6
6
|
getTotalRows: () => number;
|
|
7
7
|
isSortable: boolean;
|
|
8
8
|
};
|
|
9
|
+
declare type InitialState = Partial<VisibilityTableState & ColumnOrderTableState & ColumnPinningTableState & FiltersTableState & SortingTableState & ExpandedTableState & GroupingTableState & ColumnSizingTableState & PaginationTableState & RowSelectionTableState>;
|
|
9
10
|
declare type TableProviderProps = {
|
|
10
11
|
columns: any;
|
|
11
12
|
data: Array<Record<string, unknown>>;
|
|
@@ -14,7 +15,8 @@ declare type TableProviderProps = {
|
|
|
14
15
|
direction: 'asc' | 'desc';
|
|
15
16
|
};
|
|
16
17
|
children: React.ReactNode;
|
|
18
|
+
initialState?: InitialState;
|
|
17
19
|
};
|
|
18
|
-
export declare const DataTableProvider: ({ columns, data, defaultSort, children }: TableProviderProps) => JSX.Element;
|
|
20
|
+
export declare const DataTableProvider: ({ columns, data, defaultSort, initialState, children }: TableProviderProps) => JSX.Element;
|
|
19
21
|
export declare const useDataTable: <T extends Record<string, unknown>>() => DataTableContextType<T>;
|
|
20
22
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"react";import{useReactTable as R,getCoreRowModel as M,getPaginationRowModel as
|
|
1
|
+
import*as e from"react";import{useReactTable as R,getCoreRowModel as M,getPaginationRowModel as p,getSortedRowModel as v,getFilteredRowModel as C}from"@tanstack/react-table";const g=e.createContext(null),P=({columns:t,data:n,defaultSort:o,initialState:a=void 0,children:u})=>{const[c,S]=e.useState(!!(a!=null&&a.pagination)),[l,w]=e.useState(!1),[r,b]=e.useState(o?[{id:o.column,desc:o.direction==="desc"}]:[]),i=e.useCallback(()=>{S(!0)},[]),d=()=>n.length,s=R({columns:t,data:n,getCoreRowModel:M(),getPaginationRowModel:c?p():void 0,getSortedRowModel:l||r.length?v():void 0,initialState:a,state:{sorting:r},onSortingChange:b,getFilteredRowModel:C()}),m=e.useMemo(()=>({...s,setIsSortable:w,applyPagination:i,getTotalRows:d,isSortable:l}),[s,i,d,l]);return e.createElement(g.Provider,{value:m},u)},T=()=>{const t=e.useContext(g);if(!t)throw new Error("useDataTable can only be called from inside a DataTableProvider");return t};export{P as DataTableProvider,T as useDataTable};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"react";import{styled as n}from"../../stitches.js";const i=n("hr",{border:0,bg:"$
|
|
1
|
+
import t from"react";import{styled as n}from"../../stitches.js";const i=n("hr",{border:0,bg:"$tonal100",variants:{orientation:{horizontal:{height:1,width:"100%"},vertical:{height:"100%",width:1,minHeight:"$3"}}}}),a=t.forwardRef(({orientation:r="horizontal",...e},o)=>t.createElement(i,{ref:o,orientation:r,...e}));export{a as Divider,i as StyledDivider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as t from"react";import{styled as r}from"../../stitches.js";import{StyledDivider as
|
|
1
|
+
import*as t from"react";import{styled as r}from"../../stitches.js";import{StyledDivider as e}from"../divider/Divider.js";import{StyledHeading as d}from"../heading/Heading.js";import{StyledImage as a}from"../image/Image.js";import{StyledList as l}from"../list/List.js";import{StyledText as c}from"../text/Text.js";const f=r("div",{"& > *":{"&:not(:first-child)":{mt:"$5"},"&:not(:last-child)":{mb:"$5"}},[`& > ${d}`]:{maxWidth:"65ch"},[`& > ${c}`]:{maxWidth:"75ch"},[`& > ${l}`]:{maxWidth:"75ch"},[`& > ${e}`]:{my:"$5"},[`& > ${a}`]:{display:"block","&:not(:first-child)":{mt:"$6"},"&:not(:last-child)":{mb:"$6"}}}),o=t.forwardRef((m,i)=>t.createElement(f,{ref:i,...m}));o.displayName="StackContent";export{o as StackContent};
|