@cdx-ui/components 0.3.12 → 0.3.13
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/docs/components/data-grid/content.md +551 -5
- package/docs/components/list-item/content.md +1 -1
- package/docs/components/table/content.md +84 -0
- package/docs/llms.txt +1 -0
- package/docs/resources/release-notes/0.3.12/content.md +15 -0
- package/docs/resources/release-notes/content.md +1 -0
- package/lib/commonjs/components/CurrencyInput/styles.js +1 -1
- package/lib/commonjs/components/ListItem/styles.js +1 -1
- package/lib/commonjs/components/ListItem/styles.js.map +1 -1
- package/lib/commonjs/figma/CurrencyInput.figma.js +4 -4
- package/lib/commonjs/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressBar.figma.js +8 -5
- package/lib/commonjs/figma/ProgressBar.figma.js.map +1 -1
- package/lib/commonjs/figma/ProgressCircle.figma.js +8 -2
- package/lib/commonjs/figma/ProgressCircle.figma.js.map +1 -1
- package/lib/module/components/CurrencyInput/styles.js +1 -1
- package/lib/module/components/ListItem/styles.js +1 -1
- package/lib/module/components/ListItem/styles.js.map +1 -1
- package/lib/module/figma/CurrencyInput.figma.js +4 -4
- package/lib/module/figma/CurrencyInput.figma.js.map +1 -1
- package/lib/module/figma/ProgressBar.figma.js +8 -5
- package/lib/module/figma/ProgressBar.figma.js.map +1 -1
- package/lib/module/figma/ProgressCircle.figma.js +8 -2
- package/lib/module/figma/ProgressCircle.figma.js.map +1 -1
- package/lib/typescript/components/ListItem/index.d.ts +2 -2
- package/lib/typescript/figma/CurrencyInput.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressBar.figma.d.ts.map +1 -1
- package/lib/typescript/figma/ProgressCircle.figma.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/components/CurrencyInput/styles.ts +1 -1
- package/src/components/ListItem/index.tsx +2 -2
- package/src/components/ListItem/styles.ts +1 -1
|
@@ -107,10 +107,10 @@ type Product = {
|
|
|
107
107
|
};
|
|
108
108
|
|
|
109
109
|
const columns: GridColDef<Product>[] = [
|
|
110
|
-
{ field: 'name', headerName: 'Name', type: 'string', flex: 1, minWidth:
|
|
110
|
+
{ field: 'name', headerName: 'Name', type: 'string', flex: 1, minWidth: 160 },
|
|
111
111
|
{ field: 'price', headerName: 'Price', type: 'number', width: 120 },
|
|
112
112
|
{ field: 'listed', headerName: 'Listed', type: 'date', width: 140 },
|
|
113
|
-
{ field: 'updated', headerName: 'Updated', type: 'dateTime', width:
|
|
113
|
+
{ field: 'updated', headerName: 'Updated', type: 'dateTime', width: 200 },
|
|
114
114
|
{ field: 'active', headerName: 'Active', type: 'boolean', width: 100 },
|
|
115
115
|
{
|
|
116
116
|
field: 'status',
|
|
@@ -193,10 +193,10 @@ type Product = {
|
|
|
193
193
|
};
|
|
194
194
|
|
|
195
195
|
const columns: GridColDef<Product>[] = [
|
|
196
|
-
{ field: 'name', headerName: 'Name', type: 'string', flex: 1, minWidth:
|
|
196
|
+
{ field: 'name', headerName: 'Name', type: 'string', flex: 1, minWidth: 160 },
|
|
197
197
|
{ field: 'price', headerName: 'Price', type: 'number', width: 120 },
|
|
198
198
|
{ field: 'listed', headerName: 'Listed', type: 'date', width: 140 },
|
|
199
|
-
{ field: 'updated', headerName: 'Updated', type: 'dateTime', width:
|
|
199
|
+
{ field: 'updated', headerName: 'Updated', type: 'dateTime', width: 200 },
|
|
200
200
|
{ field: 'active', headerName: 'Active', type: 'boolean', width: 100 },
|
|
201
201
|
{
|
|
202
202
|
field: 'status',
|
|
@@ -808,6 +808,550 @@ export default function DataGridCheckboxCellsDemo() {
|
|
|
808
808
|
}
|
|
809
809
|
```
|
|
810
810
|
|
|
811
|
+
## Column visibility
|
|
812
|
+
|
|
813
|
+
Set a field to `false` in `columnVisibilityModel` to hide its column while keeping it in `columns`. A hidden column still sorts, filters, and matches search, and the filter panel still lists it, so a single visible column can show a rich cell while other fields drive the toolbar controls. With `treeData`, the first visible column becomes the tree column. The grid has no built-in control for showing or hiding columns, so keep the model in your own state. The API picker in [Tree data](#tree-data) uses it.
|
|
814
|
+
|
|
815
|
+
## Tree data
|
|
816
|
+
|
|
817
|
+
Set `treeData` and return each row's path from `getTreeDataPath`, such as `['Statements', '2026', 'Checking 4821 Oct.pdf']`. The first column becomes the tree column: an expand toggle, then the row content, indented by depth. Pass `groupingColDef` to override that column's header, width, or cell. A row attaches to its nearest ancestor that exists in `rows`, so a path does not need a row for every level.
|
|
818
|
+
|
|
819
|
+
Every other column renders, sorts, and filters as it does in a flat grid, so parents and children share the same columns. Leave a value empty where it does not apply to a level, such as a folder's size. Sorting reorders siblings at every level and keeps children under their parent.
|
|
820
|
+
|
|
821
|
+
Groups start collapsed. `defaultGroupingExpansionDepth` expands groups down to a depth (`-1` expands everything), and `isGroupExpandedByDefault` decides per row. While search, header filters, or the filter panel are active, a row stays visible when it or a descendant matches, and every group on the way to a match opens. Clearing the filter restores the groups the user had open.
|
|
822
|
+
|
|
823
|
+
Pagination counts top-level rows, so a page never splits a group. Tree data sorts and filters on the client. It cannot be combined with server pagination, sorting, or filtering.
|
|
824
|
+
|
|
825
|
+
This document library uses `groupingColDef` to draw a file-type icon and each folder's file count in the tree column, and opens the current year's statements with `isGroupExpandedByDefault`.
|
|
826
|
+
|
|
827
|
+
```tsx
|
|
828
|
+
import { HStack, Icon, type IconColor, Text } from '@cdx-ui/components';
|
|
829
|
+
import {
|
|
830
|
+
DataGrid,
|
|
831
|
+
type DataGridProps,
|
|
832
|
+
type GridColDef,
|
|
833
|
+
type GridTreeNodeParams,
|
|
834
|
+
} from '@cdx-ui/data-grid';
|
|
835
|
+
import { Csv, Description, Folder, type ForgeIcon, PictureAsPdf, TableChart } from '@cdx-ui/icons';
|
|
836
|
+
|
|
837
|
+
type DocumentType = 'Folder' | 'PDF' | 'CSV' | 'Spreadsheet' | 'Document';
|
|
838
|
+
|
|
839
|
+
// GridValidRowModel's index signature rejects otherwise equivalent interfaces.
|
|
840
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
841
|
+
type BankDocument = {
|
|
842
|
+
id: string;
|
|
843
|
+
path: string[];
|
|
844
|
+
type: DocumentType;
|
|
845
|
+
modified: Date;
|
|
846
|
+
size?: number;
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
const typeIcons: Record<DocumentType, { icon: ForgeIcon; color: IconColor }> = {
|
|
850
|
+
Folder: { icon: Folder, color: 'action' },
|
|
851
|
+
PDF: { icon: PictureAsPdf, color: 'danger' },
|
|
852
|
+
CSV: { icon: Csv, color: 'success' },
|
|
853
|
+
Spreadsheet: { icon: TableChart, color: 'success' },
|
|
854
|
+
Document: { icon: Description, color: 'info' },
|
|
855
|
+
};
|
|
856
|
+
|
|
857
|
+
const documents: BankDocument[] = [
|
|
858
|
+
{ id: 'statements', path: ['Statements'], type: 'Folder', modified: new Date(2026, 9, 31) },
|
|
859
|
+
{
|
|
860
|
+
id: 'statements-2026',
|
|
861
|
+
path: ['Statements', '2026'],
|
|
862
|
+
type: 'Folder',
|
|
863
|
+
modified: new Date(2026, 9, 31),
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
id: 'checking-2026-10',
|
|
867
|
+
path: ['Statements', '2026', 'Checking 4821 Oct.pdf'],
|
|
868
|
+
type: 'PDF',
|
|
869
|
+
modified: new Date(2026, 9, 31),
|
|
870
|
+
size: 184_320,
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
id: 'checking-2026-09',
|
|
874
|
+
path: ['Statements', '2026', 'Checking 4821 Sep.pdf'],
|
|
875
|
+
type: 'PDF',
|
|
876
|
+
modified: new Date(2026, 8, 30),
|
|
877
|
+
size: 176_128,
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
id: 'savings-2026-q3',
|
|
881
|
+
path: ['Statements', '2026', 'Savings 9310 Q3.pdf'],
|
|
882
|
+
type: 'PDF',
|
|
883
|
+
modified: new Date(2026, 8, 30),
|
|
884
|
+
size: 98_304,
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
id: 'statements-2025',
|
|
888
|
+
path: ['Statements', '2025'],
|
|
889
|
+
type: 'Folder',
|
|
890
|
+
modified: new Date(2025, 11, 31),
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
id: 'checking-2025-12',
|
|
894
|
+
path: ['Statements', '2025', 'Checking 4821 Dec.pdf'],
|
|
895
|
+
type: 'PDF',
|
|
896
|
+
modified: new Date(2025, 11, 31),
|
|
897
|
+
size: 192_512,
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
id: 'savings-2025-q4',
|
|
901
|
+
path: ['Statements', '2025', 'Savings 9310 Q4.pdf'],
|
|
902
|
+
type: 'PDF',
|
|
903
|
+
modified: new Date(2025, 11, 31),
|
|
904
|
+
size: 101_376,
|
|
905
|
+
},
|
|
906
|
+
{ id: 'tax', path: ['Tax documents'], type: 'Folder', modified: new Date(2026, 0, 31) },
|
|
907
|
+
{
|
|
908
|
+
id: 'tax-1099-int',
|
|
909
|
+
path: ['Tax documents', '1099-INT 2025.pdf'],
|
|
910
|
+
type: 'PDF',
|
|
911
|
+
modified: new Date(2026, 0, 31),
|
|
912
|
+
size: 64_512,
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
id: 'tax-1098',
|
|
916
|
+
path: ['Tax documents', '1098 Mortgage 2025.pdf'],
|
|
917
|
+
type: 'PDF',
|
|
918
|
+
modified: new Date(2026, 0, 29),
|
|
919
|
+
size: 71_680,
|
|
920
|
+
},
|
|
921
|
+
{ id: 'loans', path: ['Loans'], type: 'Folder', modified: new Date(2026, 8, 15) },
|
|
922
|
+
{
|
|
923
|
+
id: 'mortgage',
|
|
924
|
+
path: ['Loans', 'Home mortgage 7702'],
|
|
925
|
+
type: 'Folder',
|
|
926
|
+
modified: new Date(2026, 8, 15),
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
id: 'mortgage-closing',
|
|
930
|
+
path: ['Loans', 'Home mortgage 7702', 'Closing disclosure.pdf'],
|
|
931
|
+
type: 'PDF',
|
|
932
|
+
modified: new Date(2024, 4, 22),
|
|
933
|
+
size: 1_258_291,
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
id: 'mortgage-amortization',
|
|
937
|
+
path: ['Loans', 'Home mortgage 7702', 'Amortization.xlsx'],
|
|
938
|
+
type: 'Spreadsheet',
|
|
939
|
+
modified: new Date(2024, 4, 22),
|
|
940
|
+
size: 48_128,
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
id: 'mortgage-escrow',
|
|
944
|
+
path: ['Loans', 'Home mortgage 7702', 'Escrow analysis.pdf'],
|
|
945
|
+
type: 'PDF',
|
|
946
|
+
modified: new Date(2026, 8, 15),
|
|
947
|
+
size: 215_040,
|
|
948
|
+
},
|
|
949
|
+
{
|
|
950
|
+
id: 'auto-loan',
|
|
951
|
+
path: ['Loans', 'Auto loan 3318'],
|
|
952
|
+
type: 'Folder',
|
|
953
|
+
modified: new Date(2026, 6, 2),
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
id: 'auto-payoff',
|
|
957
|
+
path: ['Loans', 'Auto loan 3318', 'Payoff quote.pdf'],
|
|
958
|
+
type: 'PDF',
|
|
959
|
+
modified: new Date(2026, 6, 2),
|
|
960
|
+
size: 52_224,
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
id: 'transactions-export',
|
|
964
|
+
path: ['Transactions Oct 2026.csv'],
|
|
965
|
+
type: 'CSV',
|
|
966
|
+
modified: new Date(2026, 10, 2),
|
|
967
|
+
size: 23_552,
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
id: 'direct-deposit',
|
|
971
|
+
path: ['Direct deposit form.pdf'],
|
|
972
|
+
type: 'PDF',
|
|
973
|
+
modified: new Date(2026, 2, 9),
|
|
974
|
+
size: 88_064,
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
id: 'beneficiary',
|
|
978
|
+
path: ['Beneficiaries.docx'],
|
|
979
|
+
type: 'Document',
|
|
980
|
+
modified: new Date(2025, 10, 18),
|
|
981
|
+
size: 36_864,
|
|
982
|
+
},
|
|
983
|
+
];
|
|
984
|
+
|
|
985
|
+
const fileCountOf = new Map(
|
|
986
|
+
documents
|
|
987
|
+
.filter((folder) => folder.type === 'Folder')
|
|
988
|
+
.map((folder) => [
|
|
989
|
+
folder.id,
|
|
990
|
+
documents.filter(
|
|
991
|
+
(doc) =>
|
|
992
|
+
doc.type !== 'Folder' &&
|
|
993
|
+
folder.path.every((segment, index) => doc.path[index] === segment),
|
|
994
|
+
).length,
|
|
995
|
+
]),
|
|
996
|
+
);
|
|
997
|
+
|
|
998
|
+
const sizeFormatter = new Intl.NumberFormat('en-US', { maximumFractionDigits: 1 });
|
|
999
|
+
|
|
1000
|
+
function formatSize(bytes: number) {
|
|
1001
|
+
if (bytes < 1024) {
|
|
1002
|
+
return `${sizeFormatter.format(bytes)} B`;
|
|
1003
|
+
}
|
|
1004
|
+
if (bytes < 1024 * 1024) {
|
|
1005
|
+
return `${sizeFormatter.format(bytes / 1024)} KB`;
|
|
1006
|
+
}
|
|
1007
|
+
return `${sizeFormatter.format(bytes / (1024 * 1024))} MB`;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
const columns: GridColDef<BankDocument>[] = [
|
|
1011
|
+
{ field: 'name', headerName: 'Name', valueGetter: (_, row) => row.path.at(-1) },
|
|
1012
|
+
{ field: 'type', headerName: 'Type', width: 120 },
|
|
1013
|
+
{ field: 'modified', headerName: 'Modified', type: 'date', width: 130 },
|
|
1014
|
+
{
|
|
1015
|
+
field: 'size',
|
|
1016
|
+
headerName: 'Size',
|
|
1017
|
+
type: 'number',
|
|
1018
|
+
width: 100,
|
|
1019
|
+
valueFormatter: (value) => (typeof value === 'number' ? formatSize(value) : ''),
|
|
1020
|
+
},
|
|
1021
|
+
];
|
|
1022
|
+
|
|
1023
|
+
const groupingColDef: DataGridProps<BankDocument>['groupingColDef'] = {
|
|
1024
|
+
flex: 1,
|
|
1025
|
+
minWidth: 240,
|
|
1026
|
+
renderCell: ({ row }) => {
|
|
1027
|
+
const { icon, color } = typeIcons[row.type];
|
|
1028
|
+
const isFolder = row.type === 'Folder';
|
|
1029
|
+
return (
|
|
1030
|
+
<HStack space="sm" className="min-w-0 flex-1 items-center">
|
|
1031
|
+
<Icon as={icon} color={color} />
|
|
1032
|
+
<Text numberOfLines={1} color={isFolder ? 'action' : 'primary'}>
|
|
1033
|
+
{isFolder
|
|
1034
|
+
? `${String(row.path.at(-1))} (${String(fileCountOf.get(row.id) ?? 0)})`
|
|
1035
|
+
: row.path.at(-1)}
|
|
1036
|
+
</Text>
|
|
1037
|
+
</HStack>
|
|
1038
|
+
);
|
|
1039
|
+
},
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
const getTreeDataPath = (row: BankDocument) => row.path;
|
|
1043
|
+
const isGroupExpandedByDefault = ({ id }: GridTreeNodeParams<BankDocument>) =>
|
|
1044
|
+
id === 'statements' || id === 'statements-2026';
|
|
1045
|
+
|
|
1046
|
+
export default function DataGridTreeDataColumnsDemo() {
|
|
1047
|
+
return (
|
|
1048
|
+
<DataGrid
|
|
1049
|
+
rows={documents}
|
|
1050
|
+
columns={columns}
|
|
1051
|
+
treeData
|
|
1052
|
+
getTreeDataPath={getTreeDataPath}
|
|
1053
|
+
groupingColDef={groupingColDef}
|
|
1054
|
+
isGroupExpandedByDefault={isGroupExpandedByDefault}
|
|
1055
|
+
aria-label="Documents"
|
|
1056
|
+
className="h-130"
|
|
1057
|
+
/>
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
```
|
|
1061
|
+
|
|
1062
|
+
With `checkboxSelection`, the checkbox sits in the tree column. By default, selecting a group selects its descendants, and a group is checked when all of its children are and shows a mixed state when only some are. Set `rowSelectionPropagation` to `{ descendants: false, parents: false }` to select rows independently. Selection is kept for rows that a filter hides, unlike MUI X, and select-all applies to the rows that match the filter.
|
|
1063
|
+
|
|
1064
|
+
This picker shows each API as one rich row. `description` and `method` are hidden with `columnVisibilityModel` (see [Column visibility](#column-visibility)), so search also matches descriptions. The filter panel still lists the hidden `method` column, so filtering by method uses the panel that already exists.
|
|
1065
|
+
|
|
1066
|
+
```tsx
|
|
1067
|
+
import { useState } from 'react';
|
|
1068
|
+
import { Chip, HStack, Text, VStack } from '@cdx-ui/components';
|
|
1069
|
+
import { DataGrid, type GridColDef, type GridRowSelectionModel } from '@cdx-ui/data-grid';
|
|
1070
|
+
|
|
1071
|
+
type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
1072
|
+
|
|
1073
|
+
// GridValidRowModel's index signature rejects otherwise equivalent interfaces.
|
|
1074
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1075
|
+
type Api = {
|
|
1076
|
+
id: string;
|
|
1077
|
+
path: string[];
|
|
1078
|
+
description: string;
|
|
1079
|
+
method?: Method;
|
|
1080
|
+
};
|
|
1081
|
+
|
|
1082
|
+
const methodColors: Record<Method, 'info' | 'success' | 'warning' | 'danger'> = {
|
|
1083
|
+
GET: 'info',
|
|
1084
|
+
POST: 'success',
|
|
1085
|
+
PUT: 'warning',
|
|
1086
|
+
DELETE: 'danger',
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
const apis: Api[] = [
|
|
1090
|
+
{ id: 'accounts', path: ['Accounts'], description: 'Account information and balances' },
|
|
1091
|
+
{ id: 'oauth', path: ['Accounts', 'OAuth V1'], description: 'Token-scoped account APIs' },
|
|
1092
|
+
{
|
|
1093
|
+
id: 'list-accounts',
|
|
1094
|
+
path: ['Accounts', 'OAuth V1', 'List customer accounts'],
|
|
1095
|
+
description: 'Returns every account the customer can see',
|
|
1096
|
+
method: 'GET',
|
|
1097
|
+
},
|
|
1098
|
+
{
|
|
1099
|
+
id: 'close-account',
|
|
1100
|
+
path: ['Accounts', 'OAuth V1', 'Close account'],
|
|
1101
|
+
description: 'Closes an account with a zero balance',
|
|
1102
|
+
method: 'DELETE',
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
id: 'open-account',
|
|
1106
|
+
path: ['Accounts', 'OAuth V1', 'Open account'],
|
|
1107
|
+
description: 'Opens a new deposit account',
|
|
1108
|
+
method: 'POST',
|
|
1109
|
+
},
|
|
1110
|
+
{ id: 'balances', path: ['Accounts', 'Balances'], description: 'Real-time balance APIs' },
|
|
1111
|
+
{
|
|
1112
|
+
id: 'get-balance',
|
|
1113
|
+
path: ['Accounts', 'Balances', 'Get balance'],
|
|
1114
|
+
description: 'Returns the available and ledger balance',
|
|
1115
|
+
method: 'GET',
|
|
1116
|
+
},
|
|
1117
|
+
{ id: 'payments', path: ['Payments'], description: 'Transfers and bill pay' },
|
|
1118
|
+
{
|
|
1119
|
+
id: 'create-transfer',
|
|
1120
|
+
path: ['Payments', 'Create transfer'],
|
|
1121
|
+
description: 'Moves money between two accounts',
|
|
1122
|
+
method: 'POST',
|
|
1123
|
+
},
|
|
1124
|
+
{
|
|
1125
|
+
id: 'update-payee',
|
|
1126
|
+
path: ['Payments', 'Update payee'],
|
|
1127
|
+
description: 'Changes a bill pay payee',
|
|
1128
|
+
method: 'PUT',
|
|
1129
|
+
},
|
|
1130
|
+
];
|
|
1131
|
+
|
|
1132
|
+
const columns: GridColDef<Api>[] = [
|
|
1133
|
+
{
|
|
1134
|
+
field: 'name',
|
|
1135
|
+
headerName: 'APIs',
|
|
1136
|
+
flex: 1,
|
|
1137
|
+
minWidth: 280,
|
|
1138
|
+
valueGetter: (_, row) => row.path.at(-1),
|
|
1139
|
+
renderCell: ({ row }) => (
|
|
1140
|
+
<HStack space="sm" className="flex-1 items-center">
|
|
1141
|
+
<VStack className="min-w-0 flex-1">
|
|
1142
|
+
<Text numberOfLines={1} weight="medium">
|
|
1143
|
+
{row.path.at(-1)}
|
|
1144
|
+
</Text>
|
|
1145
|
+
<Text numberOfLines={1} color="secondary" size="sm">
|
|
1146
|
+
{row.description}
|
|
1147
|
+
</Text>
|
|
1148
|
+
</VStack>
|
|
1149
|
+
{row.method ? (
|
|
1150
|
+
<Chip color={methodColors[row.method]} size="small">
|
|
1151
|
+
<Chip.Label>{row.method}</Chip.Label>
|
|
1152
|
+
</Chip>
|
|
1153
|
+
) : null}
|
|
1154
|
+
</HStack>
|
|
1155
|
+
),
|
|
1156
|
+
},
|
|
1157
|
+
{ field: 'description', headerName: 'Description' },
|
|
1158
|
+
{ field: 'method', headerName: 'Method' },
|
|
1159
|
+
];
|
|
1160
|
+
|
|
1161
|
+
const columnVisibilityModel = { description: false, method: false };
|
|
1162
|
+
const endpointCount = apis.filter((api) => api.method).length;
|
|
1163
|
+
|
|
1164
|
+
export default function DataGridTreeDataSelectionDemo() {
|
|
1165
|
+
const [selection, setSelection] = useState<GridRowSelectionModel>({
|
|
1166
|
+
type: 'include',
|
|
1167
|
+
ids: new Set(['list-accounts', 'create-transfer']),
|
|
1168
|
+
});
|
|
1169
|
+
const selectedEndpoints = apis.filter((api) => api.method && selection.ids.has(api.id)).length;
|
|
1170
|
+
|
|
1171
|
+
return (
|
|
1172
|
+
<DataGrid
|
|
1173
|
+
rows={apis}
|
|
1174
|
+
columns={columns}
|
|
1175
|
+
columnVisibilityModel={columnVisibilityModel}
|
|
1176
|
+
treeData
|
|
1177
|
+
getTreeDataPath={(row) => row.path}
|
|
1178
|
+
defaultGroupingExpansionDepth={1}
|
|
1179
|
+
checkboxSelection
|
|
1180
|
+
rowSelectionModel={selection}
|
|
1181
|
+
onRowSelectionModelChange={setSelection}
|
|
1182
|
+
showToolbar
|
|
1183
|
+
toolbarActions={
|
|
1184
|
+
<Text color="secondary" size="sm">
|
|
1185
|
+
{`${selectedEndpoints.toString()} of ${endpointCount.toString()} endpoints selected`}
|
|
1186
|
+
</Text>
|
|
1187
|
+
}
|
|
1188
|
+
hideFooter
|
|
1189
|
+
aria-label="APIs"
|
|
1190
|
+
className="h-130"
|
|
1191
|
+
/>
|
|
1192
|
+
);
|
|
1193
|
+
}
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
## Detail panel
|
|
1197
|
+
|
|
1198
|
+
Return content from `getDetailPanelContent` to add a toggle column at the start of the grid. Opening a row shows a panel under it that spans every column. Return `null` for rows that have no details, and those rows get no toggle. Use `defaultDetailPanelExpandedRowIds`, or control `detailPanelExpandedRowIds` with `onDetailPanelExpandedRowIdsChange`, to choose which panels are open. The panel grows to fit its content.
|
|
1199
|
+
|
|
1200
|
+
The panel scrolls with the grid when it is wider than the viewport, so keep its content narrow enough to read without horizontal scrolling. When any column is pinned to start, the toggle column pins after the selection column.
|
|
1201
|
+
|
|
1202
|
+
```tsx
|
|
1203
|
+
import { Button, Chip, HStack, Text, VStack } from '@cdx-ui/components';
|
|
1204
|
+
import { DataGrid, type GridColDef } from '@cdx-ui/data-grid';
|
|
1205
|
+
import { Check, Close, ContentCopy } from '@cdx-ui/icons';
|
|
1206
|
+
|
|
1207
|
+
// GridValidRowModel's index signature rejects otherwise equivalent interfaces.
|
|
1208
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
1209
|
+
type AuditEvent = {
|
|
1210
|
+
id: string;
|
|
1211
|
+
time: string;
|
|
1212
|
+
user: string;
|
|
1213
|
+
category: 'Access' | 'Change';
|
|
1214
|
+
domain: string;
|
|
1215
|
+
eventType: string;
|
|
1216
|
+
status: 'Success' | 'Failed';
|
|
1217
|
+
details: [label: string, value: string][];
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
const events: AuditEvent[] = [
|
|
1221
|
+
{
|
|
1222
|
+
id: 'evt_8f2a6c91',
|
|
1223
|
+
time: 'Jan 12, 2026, 11:51:06 AM',
|
|
1224
|
+
user: 'Mary Jane',
|
|
1225
|
+
category: 'Change',
|
|
1226
|
+
domain: 'Track and publish',
|
|
1227
|
+
eventType: 'Login',
|
|
1228
|
+
status: 'Failed',
|
|
1229
|
+
details: [
|
|
1230
|
+
['Event ID', 'evt_8f2a6c91'],
|
|
1231
|
+
['Organisation ID', 'org_acme'],
|
|
1232
|
+
['Category', 'change'],
|
|
1233
|
+
['Environment ID', 'env_production'],
|
|
1234
|
+
['Occurred at', '2026-01-12T11:51:06Z'],
|
|
1235
|
+
['Target collection', 'articles'],
|
|
1236
|
+
['Actor type', 'user'],
|
|
1237
|
+
['Version before', '12'],
|
|
1238
|
+
['User ID', 'usr_10482'],
|
|
1239
|
+
['Version after', '13'],
|
|
1240
|
+
['User email', 'mary.jane@example.com'],
|
|
1241
|
+
['Patch path', '/title'],
|
|
1242
|
+
['Correlation ID', 'req_7d4b9e23'],
|
|
1243
|
+
['HTTP status code', '403'],
|
|
1244
|
+
],
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
id: 'evt_51ab07e4',
|
|
1248
|
+
time: 'Jan 12, 2026, 10:05:41 AM',
|
|
1249
|
+
user: 'Peter Parker',
|
|
1250
|
+
category: 'Access',
|
|
1251
|
+
domain: 'Branding and theming',
|
|
1252
|
+
eventType: 'History',
|
|
1253
|
+
status: 'Success',
|
|
1254
|
+
details: [
|
|
1255
|
+
['Event ID', 'evt_51ab07e4'],
|
|
1256
|
+
['Organisation ID', 'org_acme'],
|
|
1257
|
+
['Category', 'access'],
|
|
1258
|
+
['Environment ID', 'env_production'],
|
|
1259
|
+
['User ID', 'usr_20311'],
|
|
1260
|
+
['HTTP status code', '200'],
|
|
1261
|
+
],
|
|
1262
|
+
},
|
|
1263
|
+
{
|
|
1264
|
+
id: 'evt_c3d94f10',
|
|
1265
|
+
time: 'Jan 11, 2026, 4:18:22 PM',
|
|
1266
|
+
user: 'Jane Cooper',
|
|
1267
|
+
category: 'Access',
|
|
1268
|
+
domain: 'Track and publish',
|
|
1269
|
+
eventType: 'Login',
|
|
1270
|
+
status: 'Success',
|
|
1271
|
+
details: [
|
|
1272
|
+
['Event ID', 'evt_c3d94f10'],
|
|
1273
|
+
['Organisation ID', 'org_acme'],
|
|
1274
|
+
['User ID', 'usr_10077'],
|
|
1275
|
+
['HTTP status code', '200'],
|
|
1276
|
+
],
|
|
1277
|
+
},
|
|
1278
|
+
];
|
|
1279
|
+
|
|
1280
|
+
const columns: GridColDef<AuditEvent>[] = [
|
|
1281
|
+
{ field: 'time', headerName: 'Time', width: 220 },
|
|
1282
|
+
{ field: 'user', headerName: 'User', width: 140 },
|
|
1283
|
+
{
|
|
1284
|
+
field: 'category',
|
|
1285
|
+
headerName: 'Category',
|
|
1286
|
+
width: 120,
|
|
1287
|
+
renderCell: ({ row }) => (
|
|
1288
|
+
<Chip size="small" color={row.category === 'Access' ? 'info' : 'neutral'}>
|
|
1289
|
+
<Chip.Label>{row.category}</Chip.Label>
|
|
1290
|
+
</Chip>
|
|
1291
|
+
),
|
|
1292
|
+
},
|
|
1293
|
+
{ field: 'domain', headerName: 'Domain', flex: 1, minWidth: 180 },
|
|
1294
|
+
{ field: 'eventType', headerName: 'Event type', width: 130 },
|
|
1295
|
+
{
|
|
1296
|
+
field: 'status',
|
|
1297
|
+
headerName: 'Status',
|
|
1298
|
+
width: 120,
|
|
1299
|
+
renderCell: ({ row }) => (
|
|
1300
|
+
<Chip size="small" color={row.status === 'Success' ? 'success' : 'danger'}>
|
|
1301
|
+
<Chip.Icon as={row.status === 'Success' ? Check : Close} />
|
|
1302
|
+
<Chip.Label>{row.status}</Chip.Label>
|
|
1303
|
+
</Chip>
|
|
1304
|
+
),
|
|
1305
|
+
},
|
|
1306
|
+
];
|
|
1307
|
+
|
|
1308
|
+
function AuditEventDetails({ event }: { event: AuditEvent }) {
|
|
1309
|
+
return (
|
|
1310
|
+
<VStack space="md" className="rounded-lg bg-surface-secondary p-4">
|
|
1311
|
+
<HStack className="flex-wrap">
|
|
1312
|
+
{event.details.map(([label, value]) => (
|
|
1313
|
+
<HStack key={label} space="md" className="w-1/2 py-1">
|
|
1314
|
+
<Text color="secondary" size="sm" className="w-40">
|
|
1315
|
+
{label}:
|
|
1316
|
+
</Text>
|
|
1317
|
+
<Text size="sm" className="flex-1">
|
|
1318
|
+
{value}
|
|
1319
|
+
</Text>
|
|
1320
|
+
</HStack>
|
|
1321
|
+
))}
|
|
1322
|
+
</HStack>
|
|
1323
|
+
<Button
|
|
1324
|
+
variant="outline"
|
|
1325
|
+
size="small"
|
|
1326
|
+
className="self-end"
|
|
1327
|
+
onPress={() => {
|
|
1328
|
+
void navigator.clipboard.writeText(
|
|
1329
|
+
JSON.stringify(Object.fromEntries(event.details), null, 2),
|
|
1330
|
+
);
|
|
1331
|
+
}}
|
|
1332
|
+
>
|
|
1333
|
+
<Button.Icon as={ContentCopy} position="leading" />
|
|
1334
|
+
<Button.Label>Copy</Button.Label>
|
|
1335
|
+
</Button>
|
|
1336
|
+
</VStack>
|
|
1337
|
+
);
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
export default function DataGridDetailPanelDemo() {
|
|
1341
|
+
return (
|
|
1342
|
+
<DataGrid
|
|
1343
|
+
rows={events}
|
|
1344
|
+
columns={columns}
|
|
1345
|
+
getDetailPanelContent={({ row }) => <AuditEventDetails event={row} />}
|
|
1346
|
+
defaultDetailPanelExpandedRowIds={new Set(['evt_8f2a6c91'])}
|
|
1347
|
+
hideFooter
|
|
1348
|
+
aria-label="Audit log"
|
|
1349
|
+
className="h-130"
|
|
1350
|
+
/>
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
```
|
|
1354
|
+
|
|
811
1355
|
## Column pinning
|
|
812
1356
|
|
|
813
1357
|
Pass `pinnedColumns` with `start` and/or `end` field lists so key columns stay visible while the grid scrolls horizontally. Deprecated `left` / `right` keys are aliases for `start` / `end` (same mapping as `align`). MUI X `initialState.pinnedColumns` moves to the `pinnedColumns` prop.
|
|
@@ -1138,4 +1682,6 @@ sort. `valueOptions` is required when `type` is `singleSelect`.
|
|
|
1138
1682
|
|
|
1139
1683
|
## Accessibility
|
|
1140
1684
|
|
|
1141
|
-
The grid renders a semantic HTML table on web. Sortable headers expose `aria-sort`. Select-all and row checkboxes are labelled.
|
|
1685
|
+
The grid renders a semantic HTML table on web. Sortable headers expose `aria-sort`. Select-all and row checkboxes are labelled.
|
|
1686
|
+
|
|
1687
|
+
Tree and detail panel toggles are buttons with `aria-expanded`, labelled with the row they open, such as "Expand OAuth V1, Accounts". A partly selected tree group exposes `aria-checked="mixed"`. Expanding or collapsing never moves focus. When a filter removes the row that had focus, focus moves to the toolbar search field if `showToolbar` is on. Closing the filter panel with Escape, Remove all, or by removing the last filter returns focus to the control that opened it. A press outside the panel closes it and leaves focus where it went. The grid keeps table semantics rather than `treegrid`, so screen readers do not announce the tree level; the toggle label names the row's ancestors instead.
|
|
@@ -658,7 +658,7 @@ Group heading row with an optional accent top-border divider and an optional `su
|
|
|
658
658
|
| `children` | `ReactNode` | — | Primary section label. String or number children are styled as an uppercase label. |
|
|
659
659
|
| `asChild?` | `boolean` | — | Renders the consumer's child element in place of the default `View` host. |
|
|
660
660
|
| `trailing?` | `ReactNode` | — | Optional right-aligned adornment (e.g. section Chip). |
|
|
661
|
-
| `variant?` | `'ghost' \| 'subtle' \| 'gradient'` | `'ghost'` | Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a neutral fill (
|
|
661
|
+
| `variant?` | `'ghost' \| 'subtle' \| 'gradient'` | `'ghost'` | Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a light neutral fill (`surface-neutral-tint`) and drops the bottom border. `gradient` fades from the primary surface into a brand tint, left to right, and keeps the bottom border. Label typography is the same for all three. |
|
|
662
662
|
| `showDivider?` | `boolean` | `true` | Accent top border above the header. |
|
|
663
663
|
|
|
664
664
|
Inherits all [`ViewProps`](https://reactnative.dev/docs/view#props).
|
|
@@ -229,6 +229,90 @@ export default function TableRowActionsDemo() {
|
|
|
229
229
|
}
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
+
## Section rows
|
|
233
|
+
|
|
234
|
+
Group rows under section titles, as in a permissions matrix, with one `Table.Body` per section. Start each body with a row holding a single `Table.Head` that has `scope="rowgroup"` and a `colSpan` covering every column, so screen readers announce the section for the rows beneath it. Use `scope="row"` on the first cell of each row and name the section in each checkbox label, such as "Edit Transfers, Payments", so every control stays distinct out of context. On native, `colSpan` merges the cells but `scope` is dropped.
|
|
235
|
+
|
|
236
|
+
For sortable or filterable data with a hierarchy, use [`DataGrid` tree data](https://design.candescent.com/docs/components/data-grid/content.md#tree-data) instead.
|
|
237
|
+
|
|
238
|
+
```tsx
|
|
239
|
+
import { useState } from 'react';
|
|
240
|
+
import { Checkbox, Table, Text } from '@cdx-ui/components';
|
|
241
|
+
|
|
242
|
+
const actions = ['View', 'Edit', 'Delete'] as const;
|
|
243
|
+
type Action = (typeof actions)[number];
|
|
244
|
+
|
|
245
|
+
const sections = [
|
|
246
|
+
{ title: 'Accounts', resources: ['Balances', 'Statements'] },
|
|
247
|
+
{ title: 'Payments', resources: ['Transfers', 'Payees'] },
|
|
248
|
+
] as const;
|
|
249
|
+
|
|
250
|
+
export default function TableSectionRowsDemo() {
|
|
251
|
+
const [granted, setGranted] = useState<ReadonlySet<string>>(
|
|
252
|
+
new Set(['Balances:View', 'Transfers:View', 'Transfers:Edit']),
|
|
253
|
+
);
|
|
254
|
+
|
|
255
|
+
const toggle = (key: string) => {
|
|
256
|
+
setGranted((previous) => {
|
|
257
|
+
const next = new Set(previous);
|
|
258
|
+
if (next.has(key)) {
|
|
259
|
+
next.delete(key);
|
|
260
|
+
} else {
|
|
261
|
+
next.add(key);
|
|
262
|
+
}
|
|
263
|
+
return next;
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
return (
|
|
268
|
+
<Table>
|
|
269
|
+
<Table.Caption>Role permissions</Table.Caption>
|
|
270
|
+
<Table.Header>
|
|
271
|
+
<Table.Row>
|
|
272
|
+
<Table.Head>Resource</Table.Head>
|
|
273
|
+
{actions.map((action) => (
|
|
274
|
+
<Table.Head key={action} align="center">
|
|
275
|
+
{action}
|
|
276
|
+
</Table.Head>
|
|
277
|
+
))}
|
|
278
|
+
</Table.Row>
|
|
279
|
+
</Table.Header>
|
|
280
|
+
{sections.map((section) => (
|
|
281
|
+
<Table.Body key={section.title}>
|
|
282
|
+
<Table.Row>
|
|
283
|
+
<Table.Head scope="rowgroup" colSpan={actions.length + 1}>
|
|
284
|
+
<Text size="sm" weight="semibold">
|
|
285
|
+
{section.title}
|
|
286
|
+
</Text>
|
|
287
|
+
</Table.Head>
|
|
288
|
+
</Table.Row>
|
|
289
|
+
{section.resources.map((resource) => (
|
|
290
|
+
<Table.Row key={resource}>
|
|
291
|
+
<Table.Head scope="row">{resource}</Table.Head>
|
|
292
|
+
{actions.map((action: Action) => {
|
|
293
|
+
const key = `${resource}:${action}`;
|
|
294
|
+
const label = `${action} ${resource}, ${section.title}`;
|
|
295
|
+
return (
|
|
296
|
+
<Table.Cell key={action} align="center">
|
|
297
|
+
<Checkbox
|
|
298
|
+
value={key}
|
|
299
|
+
isChecked={granted.has(key)}
|
|
300
|
+
onChange={() => toggle(key)}
|
|
301
|
+
accessibilityLabel={label}
|
|
302
|
+
aria-label={label}
|
|
303
|
+
/>
|
|
304
|
+
</Table.Cell>
|
|
305
|
+
);
|
|
306
|
+
})}
|
|
307
|
+
</Table.Row>
|
|
308
|
+
))}
|
|
309
|
+
</Table.Body>
|
|
310
|
+
))}
|
|
311
|
+
</Table>
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
```
|
|
315
|
+
|
|
232
316
|
## In card
|
|
233
317
|
|
|
234
318
|
On mobile, a headerless table can present key-value summaries inside a card. Pair it with a compact visual summary built from layout primitives while chart components are unavailable, and keep the values in the table as the accessible source of detail.
|
package/docs/llms.txt
CHANGED
|
@@ -151,6 +151,7 @@ Links point at each page's `content.md`, which carries the page's prose, demo so
|
|
|
151
151
|
|
|
152
152
|
## Release notes
|
|
153
153
|
|
|
154
|
+
- [0.3.12](resources/release-notes/0.3.12/content.md): DataGrid adds built-in column types, pinning, type-aware filters, and polarity or delta number cells.
|
|
154
155
|
- [0.3.11](resources/release-notes/0.3.11/content.md): Read-only Input and CurrencyInput stay non-editable on Android instead of accepting edits again.
|
|
155
156
|
- [0.3.10](resources/release-notes/0.3.10/content.md): CurrencyInput no longer clips the top of default-size amounts on iOS.
|
|
156
157
|
- [0.3.9](resources/release-notes/0.3.9/content.md): DateRangePicker bottom sheets accept custom snap points, stack behavior, and fill; DataGrid keeps column headers within their bounds.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 0.3.12 (https://design.candescent.com/docs/resources/release-notes/0.3.12)
|
|
2
|
+
|
|
3
|
+
DataGrid adds built-in column types, pinning, type-aware filters, and polarity or delta number cells.
|
|
4
|
+
|
|
5
|
+
This release expands **DataGrid** with typed columns, pinning, and richer filters, bumps the Uniwind styling layer used across Forge UI, and fixes clamped **[SystemAlert](https://design.candescent.com/docs/components/system-alert/content.md)** descriptions on web.
|
|
6
|
+
|
|
7
|
+
## What's new
|
|
8
|
+
|
|
9
|
+
**DataGrid** — Set a column `type` to get defaults for display, sorting, and editing instead of wiring everything by hand. Pin columns to the left or right edge of the viewport, use filter operators that match each column’s type, and render financial-style **polarity** and **delta** number cells for signed amounts and period-over-period change. The filter panel closes on outside presses (including Escape) while nested **[DatePicker](https://design.candescent.com/docs/components/date-picker/content.md)** and Select popovers stay usable, pinned-column edge lines extend through the footer on short grids, and overlay focus handling keeps the panel open when a nested control autofocuses on mount ([#958](https://github.com/dfh-candescent/forge-design-system/pull/958)).
|
|
10
|
+
|
|
11
|
+
**Uniwind** — Forge UI packages move to a newer Uniwind release; **[Icon](https://design.candescent.com/docs/components/icon/content.md)** class handling is updated to match. If your app depends on Uniwind directly alongside `@cdx-ui/web` or `@cdx-ui/native`, align your Uniwind version with the one Forge UI pulls in to avoid duplicate or mismatched styling ([#891](https://github.com/dfh-candescent/forge-design-system/pull/891)).
|
|
12
|
+
|
|
13
|
+
## Bug fixes
|
|
14
|
+
|
|
15
|
+
**[SystemAlert](https://design.candescent.com/docs/components/system-alert/content.md)** — Multi-line descriptions with `numberOfLines` no longer show clipped text in the bottom padding on web ([#939](https://github.com/dfh-candescent/forge-design-system/pull/939)).
|
|
@@ -8,6 +8,7 @@ Notes are generated from the release commit itself, so the versions and commit r
|
|
|
8
8
|
each entry are exact. Releases that contained nothing but backlog or dependency bookkeeping
|
|
9
9
|
are omitted.
|
|
10
10
|
|
|
11
|
+
- [0.3.12](https://design.candescent.com/docs/resources/release-notes/0.3.12/content.md) — 2026-11-04 — DataGrid adds built-in column types, pinning, type-aware filters, and polarity or delta number cells.
|
|
11
12
|
- [0.3.11](https://design.candescent.com/docs/resources/release-notes/0.3.11/content.md) — 2026-10-30 — Read-only Input and CurrencyInput stay non-editable on Android instead of accepting edits again.
|
|
12
13
|
- [0.3.10](https://design.candescent.com/docs/resources/release-notes/0.3.10/content.md) — 2026-10-30 — CurrencyInput no longer clips the top of default-size amounts on iOS.
|
|
13
14
|
- [0.3.9](https://design.candescent.com/docs/resources/release-notes/0.3.9/content.md) — 2026-10-29 — DateRangePicker bottom sheets accept custom snap points, stack behavior, and fill; DataGrid keeps column headers within their bounds.
|
|
@@ -47,7 +47,7 @@ const currencyInputGhostFieldVariants = (0, _utils.cva)(['w-full bg-transparent
|
|
|
47
47
|
|
|
48
48
|
// `outline` delegates to the Input shell so border, focus, invalid, disabled, and read-only
|
|
49
49
|
// treatments (including the native `data-[field-state=...]` focus selectors) stay in one place.
|
|
50
|
-
// Figma `
|
|
50
|
+
// Figma `outline` spaces the symbol 8px from the amount, tighter than Input's 16px slot gap.
|
|
51
51
|
const currencyInputRootVariants = ({
|
|
52
52
|
variant = 'ghost',
|
|
53
53
|
size = 'default'
|
|
@@ -125,7 +125,7 @@ const listItemSectionHeaderVariants = exports.listItemSectionHeaderVariants = (0
|
|
|
125
125
|
variant: {
|
|
126
126
|
ghost: [],
|
|
127
127
|
// The fill separates the header from its rows, so the bottom border is dropped.
|
|
128
|
-
subtle: 'bg-surface-neutral-
|
|
128
|
+
subtle: 'bg-surface-neutral-tint border-b-0',
|
|
129
129
|
gradient: 'bg-gradient-to-r from-surface-primary to-surface-brand-tint'
|
|
130
130
|
},
|
|
131
131
|
showDivider: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_utils","_constants","listItemRootVariants","exports","cva","TRANSITION_COLORS","Platform","select","web","join","default","variants","size","compact","showSeparator","true","false","crossAlign","center","start","defaultVariants","listItemPressableRegionVariants","handlePosition","end","listItemLeadingSlotVariants","listItemTrailingSlotVariants","listItemDragHandleVariants","listItemContentVariants","listItemTitleVariants","listItemDescriptionVariants","listItemMetaVariants","listItemSectionHeaderVariants","variant","ghost","subtle","gradient","showDivider","listItemSectionHeaderLabelVariants"],"sourceRoot":"../../../../src","sources":["components/ListItem/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAAE,UAAG,EACrC,CACE,yEAAyE,EACzE,iGAAiG,EACjGC,4BAAiB,EACjBC,qBAAQ,CAACC,MAAM,CAAC;EACdC,GAAG,EAAE,CACH,cAAc,EACd,0HAA0H,EAC1H,+DAA+D,EAC/D,yDAAyD;EACzD;EACA,oFAAoF,EACpF,oEAAoE,EACpE,sHAAsH,CACvH,CAACC,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,EACF,2CAA2C;AAC3C;AACA;AACAJ,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,2BAA2B;EAAEE,OAAO,EAAE;AAAG,CAAC,CAAC,CACnE,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJF,OAAO,EAAE,qBAAqB;MAC9BG,OAAO,EAAE;IACX,CAAC;IACDC,aAAa,EAAE;MACbC,IAAI,EAAE,CACJ,+CAA+C,EAC/CT,qBAAQ,CAACC,MAAM,CAAC;QAAEC,GAAG,EAAE,mBAAmB;QAAEE,O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ACtE,4CAA4C,CAC7C,CAAC;;AAEF;;AAEO,MAAMuB,uBAAuB,GAAAxB,OAAA,CAAAwB,uBAAA,GAAG,IAAAvB,UAAG,EAAC,kDAAkD,EAAE;EAC7FO,QAAQ,EAAE;IACRM,UAAU,EAAE;MACVC,MAAM,EAAE,gBAAgB;MACxBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;;AAEF;;AAEO,MAAMW,qBAAqB,GAAAzB,OAAA,CAAAyB,qBAAA,GAAG,IAAAxB,UAAG,EAAC,0CAA0C,CAAC;AAE7E,MAAMyB,2BAA2B,GAAA1B,OAAA,CAAA0B,2BAAA,GAAG,IAAAzB,UAAG,EAAC,gCAAgC,CAAC;AAEzE,MAAM0B,oBAAoB,GAAA3B,OAAA,CAAA2B,oBAAA,GAAG,IAAA1B,UAAG,EAAC,+BAA+B,CAAC;;AAExE;;AAEO,MAAM2B,6BAA6B,GAAA5B,OAAA,CAAA4B,6BAAA,GAAG,IAAA3B,UAAG,EAC9C,CACE,6EAA6E,EAC7E,yBAAyB,CAC1B,EACD;EACEO,QAAQ,EAAE;IACRqB,OAAO,EAAE;MACPC,KAAK,EAAE,EAAE;MACT;MACAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_utils","_constants","listItemRootVariants","exports","cva","TRANSITION_COLORS","Platform","select","web","join","default","variants","size","compact","showSeparator","true","false","crossAlign","center","start","defaultVariants","listItemPressableRegionVariants","handlePosition","end","listItemLeadingSlotVariants","listItemTrailingSlotVariants","listItemDragHandleVariants","listItemContentVariants","listItemTitleVariants","listItemDescriptionVariants","listItemMetaVariants","listItemSectionHeaderVariants","variant","ghost","subtle","gradient","showDivider","listItemSectionHeaderLabelVariants"],"sourceRoot":"../../../../src","sources":["components/ListItem/styles.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAC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UAAG,EAAC,gCAAgC,CAAC;AAEzE,MAAM0B,oBAAoB,GAAA3B,OAAA,CAAA2B,oBAAA,GAAG,IAAA1B,UAAG,EAAC,+BAA+B,CAAC;;AAExE;;AAEO,MAAM2B,6BAA6B,GAAA5B,OAAA,CAAA4B,6BAAA,GAAG,IAAA3B,UAAG,EAC9C,CACE,6EAA6E,EAC7E,yBAAyB,CAC1B,EACD;EACEO,QAAQ,EAAE;IACRqB,OAAO,EAAE;MACPC,KAAK,EAAE,EAAE;MACT;MACAC,MAAM,EAAE,oCAAoC;MAC5CC,QAAQ,EAAE;IACZ,CAAC;IACDC,WAAW,EAAE;MACXrB,IAAI,EAAE,CAAC,0DAA0D,EAAE,YAAY,CAAC;MAChFC,KAAK,EAAE;IACT;EACF,CAAC;EACDI,eAAe,EAAE;IACfY,OAAO,EAAE,OAAO;IAChBI,WAAW,EAAE;EACf;AACF,CACF,CAAC;;AAED;AACO,MAAMC,kCAAkC,GAAAlC,OAAA,CAAAkC,kCAAA,GAAG,IAAAjC,UAAG,EACnD,sEACF,CAAC","ignoreList":[]}
|
|
@@ -12,13 +12,13 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
12
12
|
|
|
13
13
|
const instance = _figma.default.selectedInstance;
|
|
14
14
|
|
|
15
|
-
// Figma names this component AmountInput. `
|
|
16
|
-
//
|
|
15
|
+
// Figma names this component AmountInput. `ghost` is the code default (large, centered amount
|
|
16
|
+
// entry), so the prop is omitted; `outline` is the bordered variant. The trailing slot has no code
|
|
17
17
|
// equivalent, so the snippet flags it rather than substituting another component.
|
|
18
18
|
// `Viewport` only previews responsive type sizes.
|
|
19
19
|
const variant = instance.getEnum('variant', {
|
|
20
20
|
outline: 'outline',
|
|
21
|
-
|
|
21
|
+
ghost: undefined
|
|
22
22
|
});
|
|
23
23
|
const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
|
|
24
24
|
const isInvalid = instance.getEnum('isInvalid', {
|
|
@@ -35,7 +35,7 @@ const isDisabled = instance.getEnum('isDisabled', {
|
|
|
35
35
|
});
|
|
36
36
|
const currencySymbol = instance.getString('currencySymbol');
|
|
37
37
|
const amount = Number(instance.getString('value').replace(/[^0-9.]/g, ''));
|
|
38
|
-
const variantProp = _figma.default.helpers.react.renderProp('variant', variant
|
|
38
|
+
const variantProp = _figma.default.helpers.react.renderProp('variant', variant);
|
|
39
39
|
const valueProp = _figma.default.helpers.react.renderProp('value', Number.isFinite(amount) ? amount : 0);
|
|
40
40
|
const currencySymbolProp = _figma.default.helpers.react.renderProp('currencySymbol', currencySymbol === '$' ? undefined : currencySymbol);
|
|
41
41
|
const isInvalidProp = _figma.default.helpers.react.renderProp('isInvalid', isInvalid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","outline","
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","variant","getEnum","outline","ghost","undefined","showTrailingSlot","getBoolean","isInvalid","true","false","isReadOnly","isDisabled","currencySymbol","getString","amount","Number","replace","variantProp","helpers","react","renderProp","valueProp","isFinite","currencySymbolProp","isInvalidProp","isReadOnlyProp","isDisabledProp","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/CurrencyInput.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAGH,QAAQ,CAACI,OAAO,CAAC,SAAS,EAAE;EAC1CC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,M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AAEV,UAAU,CAAC;AAC/E,MAAMgB,cAAc,GAAG5B,cAAK,CAACoB,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,YAAY,EAAET,UAAU,CAAC;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAhC,OAAA,GAEjE;EACbiC,EAAE,EAAE,gBAAgB;EACpBC,OAAO,EAAE,CAAC,oDAAoD,CAAC;EAC/DC,OAAO,EAAEjC,cAAK,CAACkC,IAAI;AACrB,EAAE3B,gBAAgB,GAAGP,cAAK,CAACkC,IAAI,kEAAkE,GAAG,IAAI;AACxG;AACA,+BAA+Bf,WAAW,GAAGI,SAAS,GAAGE,kBAAkB,GAAGC,aAAa,GAAGC,cAAc,GAAGC,cAAc;AAC7H;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -42,12 +42,15 @@ const isIndeterminate = instance.getEnum('isIndeterminate', {
|
|
|
42
42
|
true: true,
|
|
43
43
|
false: false
|
|
44
44
|
});
|
|
45
|
-
//
|
|
46
|
-
//
|
|
47
|
-
// When Figma adds severity/categorical options, extend this map to the public API values.
|
|
45
|
+
// `action` is the code default, so the prop is omitted. When Figma adds the remaining
|
|
46
|
+
// severity/categorical options, extend this map to the public API values.
|
|
48
47
|
const color = instance.getEnum('color', {
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
action: undefined,
|
|
49
|
+
danger: 'danger',
|
|
50
|
+
// No code equivalent: ProgressBar has no `inherit` (currentColor) mode, so the prop is omitted.
|
|
51
|
+
inherit: undefined,
|
|
52
|
+
// No code equivalent: ProgressBar has no `neutral` indicator color, so the prop is omitted.
|
|
53
|
+
neutral: undefined
|
|
51
54
|
});
|
|
52
55
|
const colorProp = _figma.default.helpers.react.renderProp('color', color);
|
|
53
56
|
// Figma has no `size` variant yet. Code accepts `default` | `large` (see ProgressBarProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","value","getEnum","isIndeterminate","true","false","color","undefined","inherit","colorProp","helpers","react","renderProp","_default","exports","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/ProgressBar.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;;AAEvC;AACA,MAAMC,KAAK,GAAGH,QAAQ,CAACI,OAAO,CAAC,OAAO,EAAE;EACtC,GAAG,EAAE,CAAC;EACN,MAAM,EAAE,CAAC;EACT,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,OAAO,EAAE,EAAE;EACX,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,OAAO,EAAE,EAAE;EACX,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,GAAG,EAAE;AACP,CAAC,CAAC;AACF,MAAMC,eAAe,GAAGL,QAAQ,CAACI,OAAO,CAAC,iBAAiB,EAAE;EAC1DE,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF;AACA;AACA
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","value","getEnum","isIndeterminate","true","false","color","action","undefined","danger","inherit","neutral","colorProp","helpers","react","renderProp","_default","exports","id","imports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AS,GAAGb,cAAK,CAACc,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAET,KAAK,CAAC;AAChE;AACA;AAAA,IAAAU,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAEe;EACbqB,EAAE,EAAE,cAAc;EAClBC,OAAO,EAAE,CAAC,kDAAkD,CAAC;EAC7DC,OAAO,EAAErB,cAAK,CAACsB,IAAI;AACrB,sBAAsBlB,eAAe,GAAG,MAAM,GAAGF,KAAK,IAAIW,SAAS;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -11,9 +11,15 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
11
11
|
// component=ProgressCircle
|
|
12
12
|
|
|
13
13
|
const instance = _figma.default.selectedInstance;
|
|
14
|
+
|
|
15
|
+
// Figma `action` is the code `default` stroke (action tokens), so the prop is omitted.
|
|
14
16
|
const color = instance.getEnum('color', {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
action: undefined,
|
|
18
|
+
// No code equivalent: ProgressCircle has no `danger` color, so the prop is omitted.
|
|
19
|
+
danger: undefined,
|
|
20
|
+
inherit: 'inherit',
|
|
21
|
+
// No code equivalent: ProgressCircle has no `neutral` color, so the prop is omitted.
|
|
22
|
+
neutral: undefined
|
|
17
23
|
});
|
|
18
24
|
// The code only ships `large` and `small`; Figma `tiny` has no code size, so the snippet flags it
|
|
19
25
|
// instead of silently substituting another size.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","color","getEnum","undefined","inherit","size","large","small","tiny","isTiny","value","isIndeterminate","true","false","sizeProp","helpers","react","renderProp","colorProp","_default","exports","id","imports","example","code","metadata","nestable"],"sourceRoot":"../../../src","sources":["figma/ProgressCircle.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;
|
|
1
|
+
{"version":3,"names":["_figma","_interopRequireDefault","require","e","__esModule","default","instance","figma","selectedInstance","color","getEnum","action","undefined","danger","inherit","neutral","size","large","small","tiny","isTiny","value","isIndeterminate","true","false","sizeProp","helpers","react","renderProp","colorProp","_default","exports","id","imports","example","code","metadata","nestable"],"sourceRoot":"../../../src","sources":["figma/ProgressCircle.figma.ts"],"mappings":";;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA0B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAH1B;AACA;AACA;;AAGA,MAAMG,QAAQ,GAAGC,cAAK,CAACC,gBAAgB;;AAEvC;AACA,MAAMC,KAAK,GAAGH,QAAQ,CAACI,OAAO,CAAC,OAAO,EAAE;EACtCC,MAAM,EAAEC,SAAS;EACjB;EACAC,MAAM,EAAED,SAAS;EACjBE,OAAO,EAAE,SAAS;EAClB;EACAC,OAAO,EAAEH;AACX,CAAC,CAAC;AACF;AACA;AACA,MAAMI,IAAI,GAAGV,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACpCO,KAAK,EAAEL,SAAS;EAChBM,KAAK,EAAE,OAAO;EACdC,IAAI,EAAEP;AACR,CAAC,CAAC;AACF,MAAMQ,MAAM,GAAGd,QAAQ,CAACI,OAAO,CAAC,MAAM,EAAE;EACtCO,KAAK,EAAE,KAAK;EACZC,KAAK,EAAE,KAAK;EACZC,IAAI,EAAE;AACR,CAAC,CAAC;AACF;AACA;AACA,MAAME,KAAK,GAAGf,QAAQ,CAACI,OAAO,CAAC,OAAO,EAAE;EACtC,GAAG,EAAE,CAAC;EACN,MAAM,EAAE,CAAC;EACT,KA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-0', 'place
|
|
|
43
43
|
|
|
44
44
|
// `outline` delegates to the Input shell so border, focus, invalid, disabled, and read-only
|
|
45
45
|
// treatments (including the native `data-[field-state=...]` focus selectors) stay in one place.
|
|
46
|
-
// Figma `
|
|
46
|
+
// Figma `outline` spaces the symbol 8px from the amount, tighter than Input's 16px slot gap.
|
|
47
47
|
export const currencyInputRootVariants = ({
|
|
48
48
|
variant = 'ghost',
|
|
49
49
|
size = 'default'
|
|
@@ -122,7 +122,7 @@ export const listItemSectionHeaderVariants = cva(['flex-row items-center justify
|
|
|
122
122
|
variant: {
|
|
123
123
|
ghost: [],
|
|
124
124
|
// The fill separates the header from its rows, so the bottom border is dropped.
|
|
125
|
-
subtle: 'bg-surface-neutral-
|
|
125
|
+
subtle: 'bg-surface-neutral-tint border-b-0',
|
|
126
126
|
gradient: 'bg-gradient-to-r from-surface-primary to-surface-brand-tint'
|
|
127
127
|
},
|
|
128
128
|
showDivider: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","listItemRootVariants","select","web","join","default","variants","size","compact","showSeparator","true","false","crossAlign","center","start","defaultVariants","listItemPressableRegionVariants","handlePosition","end","listItemLeadingSlotVariants","listItemTrailingSlotVariants","listItemDragHandleVariants","listItemContentVariants","listItemTitleVariants","listItemDescriptionVariants","listItemMetaVariants","listItemSectionHeaderVariants","variant","ghost","subtle","gradient","showDivider","listItemSectionHeaderLabelVariants"],"sourceRoot":"../../../../src","sources":["components/ListItem/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,eAAe;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,oBAAoB,GAAGF,GAAG,CACrC,CACE,yEAAyE,EACzE,iGAAiG,EACjGC,iBAAiB,EACjBF,QAAQ,CAACI,MAAM,CAAC;EACdC,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fU,cAAc,EAAE;EAClB;AACF,CACF,CAAC;;AAED;;AAEA,OAAO,MAAME,2BAA2B,GAAGpB,GAAG,CAAC,CAC7C,yDAAyD,CAC1D,CAAC;AAEF,OAAO,MAAMqB,4BAA4B,GAAGrB,GAAG,CAC7C,CAAC,wDAAwD,CAAC,EAC1D;EACEO,QAAQ,EAAE;IACRM,UAAU,EAAE;MACVC,MAAM,EAAE,cAAc;MACtBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,UAAU,EAAE;EACd;AACF,CACF,CAAC;AAED,OAAO,MAAMS,0BAA0B,GAAGtB,GAAG,CAAC,CAC5C,sEAAsE,EACtE,4CAA4C,CAC7C,CAAC;;AAEF;;AAEA,OAAO,MAAMuB,uBAAuB,GAAGvB,GAAG,CAAC,kDAAkD,EAAE;EAC7FO,QAAQ,EAAE;IACRM,UAAU,EAAE;MACVC,MAAM,EAAE,gBAAgB;MACxBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;;AAEF;;AAEA,OAAO,MAAMW,qBAAqB,GAAGxB,GAAG,CAAC,0CAA0C,CAAC;AAEpF,OAAO,MAAMyB,2BAA2B,GAAGzB,GAAG,CAAC,gCAAgC,CAAC;AAEhF,OAAO,MAAM0B,oBAAoB,GAAG1B,GAAG,CAAC,+BAA+B,CAAC;;AAExE;;AAEA,OAAO,MAAM2B,6BAA6B,GAAG3B,GAAG,CAC9C,CACE,6EAA6E,EAC7E,yBAAyB,CAC1B,EACD;EACEO,QAAQ,EAAE;IACRqB,OAAO,EAAE;MACPC,KAAK,EAAE,EAAE;MACT;MACAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"names":["Platform","cva","TRANSITION_COLORS","listItemRootVariants","select","web","join","default","variants","size","compact","showSeparator","true","false","crossAlign","center","start","defaultVariants","listItemPressableRegionVariants","handlePosition","end","listItemLeadingSlotVariants","listItemTrailingSlotVariants","listItemDragHandleVariants","listItemContentVariants","listItemTitleVariants","listItemDescriptionVariants","listItemMetaVariants","listItemSectionHeaderVariants","variant","ghost","subtle","gradient","showDivider","listItemSectionHeaderLabelVariants"],"sourceRoot":"../../../../src","sources":["components/ListItem/styles.ts"],"mappings":";;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,GAAG,QAA2B,eAAe;AACtD,SAASC,iBAAiB,QAAQ,wBAAwB;;AAE1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,oBAAoB,GAAGF,GAAG,CACrC,CACE,yEAAyE,EACzE,iGAAiG,EACjGC,iBAAiB,EACjBF,QAAQ,CAACI,MAAM,CAAC;EACdC,GAAG,EAAE,CACH,cAAc,EACd,0HAA0H,EAC1H,+DAA+D,EAC/D,yDAAyD;EACzD;EACA,oFAAoF,EACpF,oEAAoE,EACpE,sHAAsH,CACvH,CAACC,IAAI,CAAC,GAAG,CAAC;EACXC,OAAO,EAAE;AACX,CAAC,CAAC,EACF,2CAA2C;AAC3C;AACA;AACAP,QAAQ,CAACI,MAAM,CAAC;EAAEC,GAAG,EAAE,2BAA2B;EAAEE,OAAO,EAAE;AAAG,CAAC,CAAC,CACnE,EACD;EACEC,QAAQ,EAAE;IACRC,IAAI,EAAE;MACJF,OAAO,EAAE,qBAAqB;MAC9BG,OAAO,EAAE;IACX,CAAC;IACDC,aAAa,EAAE;MACbC,IAAI,EAAE,CACJ,+CAA+C,EAC/CZ,QAAQ,CAACI,MAAM,CAAC;QAAEC,GAAG,EAAE,mBAAmB;QAAEE,OAAO,EAAE;MAAG,CAAC,CAAC,CAC3D,CAACD,IAAI,CAAC,GAAG,CAAC;MACXO,KAAK,EAAE;IACT,CAAC;IACDC,UAAU,EAAE;MACVC,MAAM,EAAE,cAAc;MACtBC,KAAK,EAAE;IACT;EACF,CAAC;EACDC,eAAe,EAAE;IACfR,IAAI,EAAE,SAAS;IACfE,aAAa,EAAE,IAAI;IACnBG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B,GAAG,CAAC,gCAAgC,CAAC;AAEhF,OAAO,MAAM0B,oBAAoB,GAAG1B,GAAG,CAAC,+BAA+B,CAAC;;AAExE;;AAEA,OAAO,MAAM2B,6BAA6B,GAAG3B,GAAG,CAC9C,CACE,6EAA6E,EAC7E,yBAAyB,CAC1B,EACD;EACEO,QAAQ,EAAE;IACRqB,OAAO,EAAE;MACPC,KAAK,EAAE,EAAE;MACT;MACAC,MAAM,EAAE,oCAAoC;MAC5CC,QAAQ,EAAE;IACZ,CAAC;IACDC,WAAW,EAAE;MACXrB,IAAI,EAAE,CAAC,0DAA0D,EAAE,YAAY,CAAC;MAChFC,KAAK,EAAE;IACT;EACF,CAAC;EACDI,eAAe,EAAE;IACfY,OAAO,EAAE,OAAO;IAChBI,WAAW,EAAE;EACf;AACF,CACF,CAAC;;AAED;AACA,OAAO,MAAMC,kCAAkC,GAAGjC,GAAG,CACnD,sEACF,CAAC","ignoreList":[]}
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
import figma from 'figma';
|
|
7
7
|
const instance = figma.selectedInstance;
|
|
8
8
|
|
|
9
|
-
// Figma names this component AmountInput. `
|
|
10
|
-
//
|
|
9
|
+
// Figma names this component AmountInput. `ghost` is the code default (large, centered amount
|
|
10
|
+
// entry), so the prop is omitted; `outline` is the bordered variant. The trailing slot has no code
|
|
11
11
|
// equivalent, so the snippet flags it rather than substituting another component.
|
|
12
12
|
// `Viewport` only previews responsive type sizes.
|
|
13
13
|
const variant = instance.getEnum('variant', {
|
|
14
14
|
outline: 'outline',
|
|
15
|
-
|
|
15
|
+
ghost: undefined
|
|
16
16
|
});
|
|
17
17
|
const showTrailingSlot = instance.getBoolean('Show TrailingSlot?');
|
|
18
18
|
const isInvalid = instance.getEnum('isInvalid', {
|
|
@@ -29,7 +29,7 @@ const isDisabled = instance.getEnum('isDisabled', {
|
|
|
29
29
|
});
|
|
30
30
|
const currencySymbol = instance.getString('currencySymbol');
|
|
31
31
|
const amount = Number(instance.getString('value').replace(/[^0-9.]/g, ''));
|
|
32
|
-
const variantProp = figma.helpers.react.renderProp('variant', variant
|
|
32
|
+
const variantProp = figma.helpers.react.renderProp('variant', variant);
|
|
33
33
|
const valueProp = figma.helpers.react.renderProp('value', Number.isFinite(amount) ? amount : 0);
|
|
34
34
|
const currencySymbolProp = figma.helpers.react.renderProp('currencySymbol', currencySymbol === '$' ? undefined : currencySymbol);
|
|
35
35
|
const isInvalidProp = figma.helpers.react.renderProp('isInvalid', isInvalid);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","outline","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","variant","getEnum","outline","ghost","undefined","showTrailingSlot","getBoolean","isInvalid","true","false","isReadOnly","isDisabled","currencySymbol","getString","amount","Number","replace","variantProp","helpers","react","renderProp","valueProp","isFinite","currencySymbolProp","isInvalidProp","isReadOnlyProp","isDisabledProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/CurrencyInput.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAGF,QAAQ,CAACG,OAAO,CAAC,SAAS,EAAE;EAC1CC,OAAO,EAAE,SAAS;EAClBC,KAAK,EAAEC;AACT,CAAC,CAAC;AACF,MAAMC,gBAAgB,GAAGP,QAAQ,CAACQ,UAAU,CAAC,oBAAoB,CAAC;AAElE,MAAMC,SAAS,GAAGT,QAAQ,CAACG,OAAO,CAAC,WAAW,EAAE;EAC9CO,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEL;AACT,CAAC,CAAC;AACF,MAAMM,UAAU,GAAGZ,QAAQ,CAACG,OAAO,CAAC,YAAY,EAAE;EAChDO,IAAI,EAAE,IAAI;EACVC,KAAK,EAAEL;AACT,CAAC,CAAC;AACF,MAAMO,UAAU,GA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,WAAW,GAAGI,SAAS,GAAGE,kBAAkB,GAAGC,aAAa,GAAGC,cAAc,GAAGC,cAAc;AAC7H;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -36,12 +36,15 @@ const isIndeterminate = instance.getEnum('isIndeterminate', {
|
|
|
36
36
|
true: true,
|
|
37
37
|
false: false
|
|
38
38
|
});
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// When Figma adds severity/categorical options, extend this map to the public API values.
|
|
39
|
+
// `action` is the code default, so the prop is omitted. When Figma adds the remaining
|
|
40
|
+
// severity/categorical options, extend this map to the public API values.
|
|
42
41
|
const color = instance.getEnum('color', {
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
action: undefined,
|
|
43
|
+
danger: 'danger',
|
|
44
|
+
// No code equivalent: ProgressBar has no `inherit` (currentColor) mode, so the prop is omitted.
|
|
45
|
+
inherit: undefined,
|
|
46
|
+
// No code equivalent: ProgressBar has no `neutral` indicator color, so the prop is omitted.
|
|
47
|
+
neutral: undefined
|
|
45
48
|
});
|
|
46
49
|
const colorProp = figma.helpers.react.renderProp('color', color);
|
|
47
50
|
// Figma has no `size` variant yet. Code accepts `default` | `large` (see ProgressBarProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","value","getEnum","isIndeterminate","true","false","color","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","value","getEnum","isIndeterminate","true","false","color","action","undefined","danger","inherit","neutral","colorProp","helpers","react","renderProp","id","imports","example","code"],"sourceRoot":"../../../src","sources":["figma/ProgressBar.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,KAAK,GAAGF,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtC,GAAG,EAAE,CAAC;EACN,MAAM,EAAE,CAAC;EACT,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,OAAO,EAAE,EAAE;EACX,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,OAAO,EAAE,EAAE;EACX,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,KAAK,EAAE,EAAE;EACT,MAAM,EAAE,EAAE;EACV,GAAG,EAAE;AACP,CAAC,CAAC;AACF,MAAMC,eAAe,GAAGJ,QAAQ,CAACG,OAAO,CAAC,iBAAiB,EAAE;EAC1DE,IAAI,EAAE,IAAI;EACVC,KAAK,EAAE;AACT,CAAC,CAAC;AACF;AACA;AACA,MAAMC,KAAK,GAAGP,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtCK,MAAM,EAAEC,SAAS;EACjBC,MAAM,EAAE,QAAQ;EAChB;EACAC,OAAO,EAAEF,SAAS;EAClB;EACAG,OAAO,EAAEH;AACX,CAAC,CAAC;AACF,MAAMI,SAAS,GAAGd,KAAK,CAACe,OAAO,CAACC,KAAK,CAACC,UAAU,CAAC,OAAO,EAAET,KAAK,CAAC;AAChE;AACA;;AAEA,eAAe;EACbU,EAAE,EAAE,cAAc;EAClBC,OAAO,EAAE,CAAC,kDAAkD,CAAC;EAC7DC,OAAO,EAAEpB,KAAK,CAACqB,IAAI;AACrB,sBAAsBhB,eAAe,GAAG,MAAM,GAAGF,KAAK,IAAIW,SAAS;AACnE;AACA;AACA,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,15 @@
|
|
|
5
5
|
// component=ProgressCircle
|
|
6
6
|
import figma from 'figma';
|
|
7
7
|
const instance = figma.selectedInstance;
|
|
8
|
+
|
|
9
|
+
// Figma `action` is the code `default` stroke (action tokens), so the prop is omitted.
|
|
8
10
|
const color = instance.getEnum('color', {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
action: undefined,
|
|
12
|
+
// No code equivalent: ProgressCircle has no `danger` color, so the prop is omitted.
|
|
13
|
+
danger: undefined,
|
|
14
|
+
inherit: 'inherit',
|
|
15
|
+
// No code equivalent: ProgressCircle has no `neutral` color, so the prop is omitted.
|
|
16
|
+
neutral: undefined
|
|
11
17
|
});
|
|
12
18
|
// The code only ships `large` and `small`; Figma `tiny` has no code size, so the snippet flags it
|
|
13
19
|
// instead of silently substituting another size.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["figma","instance","selectedInstance","color","getEnum","
|
|
1
|
+
{"version":3,"names":["figma","instance","selectedInstance","color","getEnum","action","undefined","danger","inherit","neutral","size","large","small","tiny","isTiny","value","isIndeterminate","true","false","sizeProp","helpers","react","renderProp","colorProp","id","imports","example","code","metadata","nestable"],"sourceRoot":"../../../src","sources":["figma/ProgressCircle.figma.ts"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,KAAK,MAAM,OAAO;AAEzB,MAAMC,QAAQ,GAAGD,KAAK,CAACE,gBAAgB;;AAEvC;AACA,MAAMC,KAAK,GAAGF,QAAQ,CAACG,OAAO,CAAC,OAAO,EAAE;EACtCC,MAAM,EAAEC,SAAS;EACjB;EACAC,MAAM,EAAED,SAAS;EACjBE,OAAO,EAAE,SAAS;EAClB;EACAC,OAAO,EAAEH;AACX,CAAC,CAAC;AACF;AACA;AACA,MAAMI,IAAI,GAAGT,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACpCO,KAAK,EAAEL,SAAS;EAChBM,KAAK,EAAE,OAAO;EACdC,IAAI,EAAEP;AACR,CAAC,CAAC;AACF,MAAMQ,MAAM,GAAGb,QAAQ,CAACG,OAAO,CAAC,MAAM,EAAE;EACtCO,KAAK,EAAE,KAAK;EACZC,KAAK,EAA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,QAAQ,EAAE;IAAEC,QAAQ,EAAE;EAAK;AAC7B,CAAC","ignoreList":[]}
|
|
@@ -101,8 +101,8 @@ export interface ListItemSectionHeaderProps extends ViewProps {
|
|
|
101
101
|
/** Optional right-aligned adornment (e.g. section Chip). */
|
|
102
102
|
trailing?: ReactNode;
|
|
103
103
|
/**
|
|
104
|
-
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a neutral
|
|
105
|
-
* (
|
|
104
|
+
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a light neutral
|
|
105
|
+
* fill (`surface-neutral-tint`) and drops the bottom border. `gradient`
|
|
106
106
|
* fades from the primary surface into a brand tint, left to right, and keeps the bottom border.
|
|
107
107
|
* Label typography is the same for all three.
|
|
108
108
|
* @default 'ghost'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CurrencyInput.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/CurrencyInput.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"CurrencyInput.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/CurrencyInput.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAwC1B,wBASE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressBar.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ProgressBar.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;
|
|
1
|
+
{"version":3,"file":"ProgressBar.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ProgressBar.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;AAgD1B,wBAOE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProgressCircle.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ProgressCircle.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ProgressCircle.figma.d.ts","sourceRoot":"","sources":["../../../src/figma/ProgressCircle.figma.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;;;;;;;;;AA0D1B,wBASE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cdx-ui/components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
"@marceloterreiro/flash-calendar": "2.0.0",
|
|
107
107
|
"react-native-reanimated-carousel": "5.0.0-beta.5",
|
|
108
108
|
"uniwind": "1.12.2",
|
|
109
|
-
"@cdx-ui/
|
|
110
|
-
"@cdx-ui/
|
|
111
|
-
"@cdx-ui/
|
|
112
|
-
"@cdx-ui/
|
|
109
|
+
"@cdx-ui/formatters": "0.3.13",
|
|
110
|
+
"@cdx-ui/icons": "0.3.13",
|
|
111
|
+
"@cdx-ui/primitives": "0.3.13",
|
|
112
|
+
"@cdx-ui/utils": "0.3.13"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
115
|
"@dnd-kit/core": "6.3.1",
|
|
@@ -79,7 +79,7 @@ const currencyInputGhostFieldVariants = cva(
|
|
|
79
79
|
|
|
80
80
|
// `outline` delegates to the Input shell so border, focus, invalid, disabled, and read-only
|
|
81
81
|
// treatments (including the native `data-[field-state=...]` focus selectors) stay in one place.
|
|
82
|
-
// Figma `
|
|
82
|
+
// Figma `outline` spaces the symbol 8px from the amount, tighter than Input's 16px slot gap.
|
|
83
83
|
export const currencyInputRootVariants = ({
|
|
84
84
|
variant = 'ghost',
|
|
85
85
|
size = 'default',
|
|
@@ -521,8 +521,8 @@ export interface ListItemSectionHeaderProps extends ViewProps {
|
|
|
521
521
|
/** Optional right-aligned adornment (e.g. section Chip). */
|
|
522
522
|
trailing?: ReactNode;
|
|
523
523
|
/**
|
|
524
|
-
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a neutral
|
|
525
|
-
* (
|
|
524
|
+
* Background treatment. `ghost` has no fill and a bottom border; `subtle` adds a light neutral
|
|
525
|
+
* fill (`surface-neutral-tint`) and drops the bottom border. `gradient`
|
|
526
526
|
* fades from the primary surface into a brand tint, left to right, and keeps the bottom border.
|
|
527
527
|
* Label typography is the same for all three.
|
|
528
528
|
* @default 'ghost'
|
|
@@ -153,7 +153,7 @@ export const listItemSectionHeaderVariants = cva(
|
|
|
153
153
|
variant: {
|
|
154
154
|
ghost: [],
|
|
155
155
|
// The fill separates the header from its rows, so the bottom border is dropped.
|
|
156
|
-
subtle: 'bg-surface-neutral-
|
|
156
|
+
subtle: 'bg-surface-neutral-tint border-b-0',
|
|
157
157
|
gradient: 'bg-gradient-to-r from-surface-primary to-surface-brand-tint',
|
|
158
158
|
},
|
|
159
159
|
showDivider: {
|