@arbor-education/design-system.components 0.16.0 → 0.17.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/.gather/instructions/project-overview.md +0 -4
- package/.gather/skills/aroo-hunni/SKILL.md +58 -0
- package/CHANGELOG.md +31 -0
- package/CONTRIBUTING.md +1 -0
- package/dist/components/arborLogo/ArborLogo.d.ts +9 -0
- package/dist/components/arborLogo/ArborLogo.d.ts.map +1 -0
- package/dist/components/arborLogo/ArborLogo.js +17 -0
- package/dist/components/arborLogo/ArborLogo.js.map +1 -0
- package/dist/components/arborLogo/ArborLogo.stories.d.ts +94 -0
- package/dist/components/arborLogo/ArborLogo.stories.d.ts.map +1 -0
- package/dist/components/arborLogo/ArborLogo.stories.js +418 -0
- package/dist/components/arborLogo/ArborLogo.stories.js.map +1 -0
- package/dist/components/arborLogo/ArborLogo.test.d.ts +2 -0
- package/dist/components/arborLogo/ArborLogo.test.d.ts.map +1 -0
- package/dist/components/arborLogo/ArborLogo.test.js +32 -0
- package/dist/components/arborLogo/ArborLogo.test.js.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.d.ts +19 -0
- package/dist/components/dataViewCard/DataViewCard.d.ts.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.js +13 -0
- package/dist/components/dataViewCard/DataViewCard.js.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.stories.d.ts +100 -0
- package/dist/components/dataViewCard/DataViewCard.stories.d.ts.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.stories.js +317 -0
- package/dist/components/dataViewCard/DataViewCard.stories.js.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.test.d.ts +2 -0
- package/dist/components/dataViewCard/DataViewCard.test.d.ts.map +1 -0
- package/dist/components/dataViewCard/DataViewCard.test.js +67 -0
- package/dist/components/dataViewCard/DataViewCard.test.js.map +1 -0
- package/dist/components/row/Row.d.ts +2 -1
- package/dist/components/row/Row.d.ts.map +1 -1
- package/dist/components/row/Row.js +2 -2
- package/dist/components/row/Row.js.map +1 -1
- package/dist/components/table/Table.stories.d.ts +1 -0
- package/dist/components/table/Table.stories.d.ts.map +1 -1
- package/dist/components/table/Table.stories.js +27 -2
- package/dist/components/table/Table.stories.js.map +1 -1
- package/dist/components/table/Table.test.js +30 -0
- package/dist/components/table/Table.test.js.map +1 -1
- package/dist/components/table/tableControls/HideColumnsDropdown.d.ts.map +1 -1
- package/dist/components/table/tableControls/HideColumnsDropdown.js +9 -3
- package/dist/components/table/tableControls/HideColumnsDropdown.js.map +1 -1
- package/dist/components/treeRow/TreeRow.d.ts +32 -0
- package/dist/components/treeRow/TreeRow.d.ts.map +1 -0
- package/dist/components/treeRow/TreeRow.js +19 -0
- package/dist/components/treeRow/TreeRow.js.map +1 -0
- package/dist/components/treeRow/TreeRow.stories.d.ts +13 -0
- package/dist/components/treeRow/TreeRow.stories.d.ts.map +1 -0
- package/dist/components/treeRow/TreeRow.stories.js +774 -0
- package/dist/components/treeRow/TreeRow.stories.js.map +1 -0
- package/dist/components/treeRow/TreeRow.test.d.ts +2 -0
- package/dist/components/treeRow/TreeRow.test.d.ts.map +1 -0
- package/dist/components/treeRow/TreeRow.test.js +262 -0
- package/dist/components/treeRow/TreeRow.test.js.map +1 -0
- package/dist/components/treeRow/TreeRowSection.d.ts +12 -0
- package/dist/components/treeRow/TreeRowSection.d.ts.map +1 -0
- package/dist/components/treeRow/TreeRowSection.js +20 -0
- package/dist/components/treeRow/TreeRowSection.js.map +1 -0
- package/dist/index.css +146 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/arborLogo/ArborLogo.stories.tsx +663 -0
- package/src/components/arborLogo/ArborLogo.test.tsx +36 -0
- package/src/components/arborLogo/ArborLogo.tsx +92 -0
- package/src/components/arborLogo/__snapshots__/ArborLogo.test.tsx.snap +424 -0
- package/src/components/dataViewCard/DataViewCard.stories.tsx +464 -0
- package/src/components/dataViewCard/DataViewCard.test.tsx +127 -0
- package/src/components/dataViewCard/DataViewCard.tsx +62 -0
- package/src/components/dataViewCard/dataViewCard.scss +25 -0
- package/src/components/row/Row.tsx +4 -1
- package/src/components/row/row.scss +9 -1
- package/src/components/table/Table.stories.tsx +49 -2
- package/src/components/table/Table.test.tsx +53 -0
- package/src/components/table/tableControls/HideColumnsDropdown.tsx +11 -2
- package/src/components/treeRow/TreeRow.stories.tsx +870 -0
- package/src/components/treeRow/TreeRow.test.tsx +371 -0
- package/src/components/treeRow/TreeRow.tsx +85 -0
- package/src/components/treeRow/TreeRowSection.tsx +56 -0
- package/src/components/treeRow/treeRow.scss +134 -0
- package/src/docs/Contributing.mdx +1 -0
- package/src/index.scss +2 -0
- package/src/index.ts +4 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
+
export type { TreeRowSectionProps } from '../treeRow/TreeRowSection';
|
|
3
|
+
export type TreeRowItem = {
|
|
4
|
+
id?: string;
|
|
5
|
+
label?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
note?: string;
|
|
8
|
+
onClick?: MouseEventHandler<HTMLDivElement>;
|
|
9
|
+
children?: TreeRowItem[];
|
|
10
|
+
};
|
|
11
|
+
type TreeRowBaseProps = {
|
|
12
|
+
defaultValue?: string[];
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
type TreeRowDataDrivenProps = TreeRowBaseProps & {
|
|
16
|
+
items: TreeRowItem[];
|
|
17
|
+
children?: never;
|
|
18
|
+
};
|
|
19
|
+
type TreeRowCompoundProps = TreeRowBaseProps & {
|
|
20
|
+
items?: never;
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
};
|
|
23
|
+
export type TreeRowProps = TreeRowDataDrivenProps | TreeRowCompoundProps;
|
|
24
|
+
export declare const TreeRow: {
|
|
25
|
+
({ items, defaultValue, children, className }: TreeRowProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
Section: ({ id: idProp, label, children, className, onClick }: import("../treeRow/TreeRowSection").TreeRowSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
export declare namespace TreeRow {
|
|
29
|
+
type Item = TreeRowItem;
|
|
30
|
+
type Props = TreeRowProps;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=TreeRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeRow.d.ts","sourceRoot":"","sources":["../../../src/components/treeRow/TreeRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAM1D,YAAY,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,KAAK,sBAAsB,GAAG,gBAAgB,GAAG;IAC/C,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG,gBAAgB,GAAG;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAkCzE,eAAO,MAAM,OAAO;mDAAkD,YAAY;;CAUjF,CAAC;AAIF,yBAAiB,OAAO,CAAC;IACvB,KAAY,IAAI,GAAG,WAAW,CAAC;IAC/B,KAAY,KAAK,GAAG,YAAY,CAAC;CAClC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import * as Accordion from '@radix-ui/react-accordion';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { Row } from '../row/Row';
|
|
6
|
+
import { DepthContext, getDepthPadding, TreeRowSection } from '../treeRow/TreeRowSection';
|
|
7
|
+
const DataDrivenList = ({ items }) => {
|
|
8
|
+
const depth = useContext(DepthContext);
|
|
9
|
+
return (_jsx(_Fragment, { children: items.map((item, index) => {
|
|
10
|
+
const hasChildren = Array.isArray(item.children) && item.children.length > 0;
|
|
11
|
+
if (!hasChildren) {
|
|
12
|
+
return (_jsx(Row, { label: item.label, value: item.value, note: item.note, onClick: item.onClick, className: "ds-tree-row__row", style: { paddingLeft: getDepthPadding(depth) } }, item.id ?? item.label ?? String(index)));
|
|
13
|
+
}
|
|
14
|
+
return (_jsx(TreeRowSection, { id: item.id, label: item.label ?? '', onClick: item.onClick, children: _jsx(DataDrivenList, { items: item.children ?? [] }) }, item.id ?? item.label ?? String(index)));
|
|
15
|
+
}) }));
|
|
16
|
+
};
|
|
17
|
+
export const TreeRow = ({ items, defaultValue, children, className }) => (_jsx(Accordion.Root, { type: "multiple", defaultValue: defaultValue, className: classNames('ds-tree-row', className), children: _jsx(DepthContext.Provider, { value: 0, children: items ? _jsx(DataDrivenList, { items: items }) : children }) }));
|
|
18
|
+
TreeRow.Section = TreeRowSection;
|
|
19
|
+
//# sourceMappingURL=TreeRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeRow.js","sourceRoot":"","sources":["../../../src/components/treeR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,IAAI,EAAE,GAAI,IAD3B,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,CAAC,CAE1C,CAClB,CAAC;QACJ,CAAC,CAAC,GACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAgB,EAAE,EAAE,CAAC,CACrF,KAAC,SAAS,CAAC,IAAI,IACb,IAAI,EAAC,UAAU,EACf,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,UAAU,CAAC,aAAa,EAAE,SAAS,CAAC,YAE/C,KAAC,YAAY,CAAC,QAAQ,IAAC,KAAK,EAAE,CAAC,YAC5B,KAAK,CAAC,CAAC,CAAC,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,QAAQ,GAC9B,GACT,CAClB,CAAC;AAEF,OAAO,CAAC,OAAO,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { TreeRow } from '../treeRow/TreeRow';
|
|
3
|
+
declare const meta: Meta<typeof TreeRow>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TreeRow>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const PreOpenedSections: Story;
|
|
8
|
+
export declare const DeepNesting: Story;
|
|
9
|
+
export declare const ClickableSections: Story;
|
|
10
|
+
export declare const ClickableRows: Story;
|
|
11
|
+
export declare const MixedClickability: Story;
|
|
12
|
+
export declare const WithClickFeedback: Story;
|
|
13
|
+
//# sourceMappingURL=TreeRow.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TreeRow.stories.d.ts","sourceRoot":"","sources":["../../../src/components/treeRow/TreeRow.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAW5D,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AA+JrD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CA8C9B,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAC;AAMtC,eAAO,MAAM,OAAO,EAAE,KAwBrB,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,KA6F/B,CAAC;AAMF,eAAO,MAAM,WAAW,EAAE,KAuHzB,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,KA2F/B,CAAC;AAMF,eAAO,MAAM,aAAa,EAAE,KAiF3B,CAAC;AAMF,eAAO,MAAM,iBAAiB,EAAE,KA6F/B,CAAC;AAkDF,eAAO,MAAM,iBAAiB,EAAE,KA8D/B,CAAC"}
|