@osdk/react-components 0.2.0-beta.1 → 0.2.0-beta.3
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 +35 -0
- package/README.md +21 -5
- package/build/browser/base-components/action-button/ActionButton.js +31 -0
- package/build/browser/base-components/action-button/ActionButton.js.map +1 -0
- package/build/browser/base-components/action-button/ActionButton.module.css +70 -0
- package/build/browser/base-components/action-button/ActionButton.module.css.js +8 -0
- package/build/browser/base-components/checkbox/Checkbox.js +27 -32
- package/build/browser/base-components/checkbox/Checkbox.module.css +79 -0
- package/build/browser/base-components/checkbox/Checkbox.module.css.js +7 -0
- package/build/browser/base-components/combobox/Combobox.js +124 -0
- package/build/browser/base-components/combobox/Combobox.js.map +1 -0
- package/build/browser/base-components/combobox/Combobox.module.css +177 -0
- package/build/browser/base-components/combobox/Combobox.module.css.js +16 -0
- package/build/browser/base-components/dialog/Dialog.js +52 -0
- package/build/browser/base-components/dialog/Dialog.js.map +1 -0
- package/build/browser/base-components/dialog/Dialog.module.css +101 -0
- package/build/browser/base-components/dialog/Dialog.module.css.js +13 -0
- package/build/browser/base-components/draggable-list/DraggableList.js +155 -0
- package/build/browser/base-components/draggable-list/DraggableList.js.map +1 -0
- package/build/browser/base-components/draggable-list/DraggableList.module.css +108 -0
- package/build/browser/base-components/draggable-list/DraggableList.module.css.js +11 -0
- package/build/browser/base-components/search-bar/SearchBar.js +44 -0
- package/build/browser/base-components/search-bar/SearchBar.js.map +1 -0
- package/build/browser/base-components/search-bar/SearchBar.module.css +53 -0
- package/build/browser/base-components/search-bar/SearchBar.module.css.js +8 -0
- package/build/browser/base-components/select/Select.js +89 -0
- package/build/browser/base-components/select/Select.js.map +1 -0
- package/build/browser/base-components/select/Select.module.css +138 -0
- package/build/browser/base-components/select/Select.module.css.js +11 -0
- package/build/browser/base-components/switch/Switch.js +33 -0
- package/build/browser/base-components/switch/Switch.js.map +1 -0
- package/build/browser/base-components/switch/Switch.module.css +91 -0
- package/build/browser/base-components/switch/Switch.module.css.js +7 -0
- package/build/browser/filter-list/FilterListApi.js.map +1 -1
- package/build/browser/filter-list/FilterListItemApi.js.map +1 -1
- package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js +296 -0
- package/build/browser/filter-list/__tests__/filterStateToWhereClause.test.js.map +1 -0
- package/build/browser/filter-list/__tests__/getFilterKey.test.js +53 -0
- package/build/browser/filter-list/__tests__/getFilterKey.test.js.map +1 -0
- package/build/browser/filter-list/__tests__/testUtils.js +192 -0
- package/build/browser/filter-list/__tests__/testUtils.js.map +1 -0
- package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js +128 -0
- package/build/browser/filter-list/hooks/__tests__/useFilterListState.test.js.map +1 -0
- package/build/browser/filter-list/hooks/useDebouncedValue.js +52 -0
- package/build/browser/filter-list/hooks/useDebouncedValue.js.map +1 -0
- package/build/browser/filter-list/hooks/useFilterListState.js +119 -0
- package/build/browser/filter-list/hooks/useFilterListState.js.map +1 -0
- package/build/browser/filter-list/hooks/usePropertyAggregation.js +92 -0
- package/build/browser/filter-list/hooks/usePropertyAggregation.js.map +1 -0
- package/build/browser/filter-list/types/AddFilterMenuTypes.js +2 -0
- package/build/browser/filter-list/types/AddFilterMenuTypes.js.map +1 -0
- package/build/browser/filter-list/types/CustomRendererTypes.js +2 -0
- package/build/browser/filter-list/types/CustomRendererTypes.js.map +1 -0
- package/build/browser/filter-list/types/KeywordSearchTypes.js +2 -0
- package/build/browser/filter-list/types/KeywordSearchTypes.js.map +1 -0
- package/build/browser/filter-list/types/LinkedFilterTypes.js +2 -0
- package/build/browser/filter-list/types/LinkedFilterTypes.js.map +1 -0
- package/build/browser/filter-list/types/index.js +21 -0
- package/build/browser/filter-list/types/index.js.map +1 -0
- package/build/browser/filter-list/utils/assertUnreachable.js +25 -0
- package/build/browser/filter-list/utils/assertUnreachable.js.map +1 -0
- package/build/browser/filter-list/utils/coerceFilterValue.js +33 -0
- package/build/browser/filter-list/utils/coerceFilterValue.js.map +1 -0
- package/build/browser/filter-list/utils/filterStateToWhereClause.js +337 -0
- package/build/browser/filter-list/utils/filterStateToWhereClause.js.map +1 -0
- package/build/browser/filter-list/utils/filterValues.js +55 -0
- package/build/browser/filter-list/utils/filterValues.js.map +1 -0
- package/build/browser/filter-list/utils/getFilterKey.js +34 -0
- package/build/browser/filter-list/utils/getFilterKey.js.map +1 -0
- package/build/browser/object-table/CellContextMenu.js +23 -20
- package/build/browser/object-table/CellContextMenu.module.css +20 -0
- package/build/browser/object-table/CellContextMenu.module.css.js +6 -0
- package/build/browser/object-table/ColumnConfigDialog.js +259 -0
- package/build/browser/object-table/ColumnConfigDialog.js.map +1 -0
- package/build/browser/object-table/ColumnConfigDialog.module.css +247 -0
- package/build/browser/object-table/ColumnConfigDialog.module.css.js +29 -0
- package/build/browser/object-table/LoadingCell.js +24 -29
- package/build/browser/object-table/LoadingCell.module.css +48 -0
- package/build/browser/object-table/LoadingCell.module.css.js +8 -0
- package/build/browser/object-table/LoadingRow.js +24 -50
- package/build/browser/object-table/LoadingStateTable.js +49 -343
- package/build/browser/object-table/LoadingStateTable.js.map +1 -1
- package/build/browser/object-table/MultiColumnSortDialog.js +178 -0
- package/build/browser/object-table/MultiColumnSortDialog.js.map +1 -0
- package/build/browser/object-table/MultiColumnSortDialog.module.css +195 -0
- package/build/browser/object-table/MultiColumnSortDialog.module.css.js +22 -0
- package/build/browser/object-table/NonIdealState.js +23 -20
- package/build/browser/object-table/NonIdealState.module.css +27 -0
- package/build/browser/object-table/NonIdealState.module.css.js +7 -0
- package/build/browser/object-table/ObjectTable.js +43 -13
- package/build/browser/object-table/ObjectTable.js.map +1 -1
- package/build/browser/object-table/ObjectTableApi.js.map +1 -1
- package/build/browser/object-table/SortableItemsList.js +35 -0
- package/build/browser/object-table/SortableItemsList.js.map +1 -0
- package/build/browser/object-table/Table.js +54 -934
- package/build/browser/object-table/Table.js.map +1 -1
- package/build/browser/object-table/Table.module.css +29 -0
- package/build/browser/object-table/Table.module.css.js +6 -0
- package/build/browser/object-table/TableBody.js +36 -260
- package/build/browser/object-table/TableBody.module.css +20 -0
- package/build/browser/object-table/TableBody.module.css.js +6 -0
- package/build/browser/object-table/TableCell.js +31 -111
- package/build/browser/object-table/TableCell.module.css +73 -0
- package/build/browser/object-table/TableCell.module.css.js +8 -0
- package/build/browser/object-table/TableHeader.js +126 -216
- package/build/browser/object-table/TableHeader.js.map +1 -1
- package/build/browser/object-table/TableHeader.module.css +106 -0
- package/build/browser/object-table/TableHeader.module.css.js +10 -0
- package/build/browser/object-table/TableHeaderContent.js +21 -18
- package/build/browser/object-table/TableHeaderContent.module.css +30 -0
- package/build/browser/object-table/TableHeaderContent.module.css.js +6 -0
- package/build/browser/object-table/TableHeaderWithPopover.js +110 -93
- package/build/browser/object-table/TableHeaderWithPopover.js.map +1 -1
- package/build/browser/object-table/TableHeaderWithPopover.module.css +141 -0
- package/build/browser/object-table/TableHeaderWithPopover.module.css.js +17 -0
- package/build/browser/object-table/TableRow.js +26 -144
- package/build/browser/object-table/TableRow.module.css +60 -0
- package/build/browser/object-table/TableRow.module.css.js +6 -0
- package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js +160 -138
- package/build/browser/object-table/hooks/__tests__/useColumnVisibility.test.js.map +1 -1
- package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js +3 -0
- package/build/browser/object-table/hooks/__tests__/useRowSelection.test.js.map +1 -1
- package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js +27 -82
- package/build/browser/object-table/hooks/__tests__/useSelectionColumn.test.js.map +1 -1
- package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js +290 -0
- package/build/browser/object-table/hooks/__tests__/useTableSorting.test.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnDefs.js +7 -2
- package/build/browser/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/browser/object-table/hooks/useColumnResize.js +45 -0
- package/build/browser/object-table/hooks/useColumnResize.js.map +1 -0
- package/build/browser/object-table/hooks/useColumnVisibility.js +52 -20
- package/build/browser/object-table/hooks/useColumnVisibility.js.map +1 -1
- package/build/browser/object-table/hooks/useRowSelection.js +8 -7
- package/build/browser/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/browser/object-table/hooks/useSelectionColumn.js +15 -6
- package/build/browser/object-table/hooks/useSelectionColumn.js.map +1 -1
- package/build/browser/object-table/utils/types.js +2 -0
- package/build/browser/object-table/utils/types.js.map +1 -0
- package/build/browser/public/experimental.js +1 -0
- package/build/browser/public/experimental.js.map +1 -1
- package/build/browser/styles.css +1875 -0
- package/build/cjs/public/experimental.cjs +1036 -197
- package/build/cjs/public/experimental.cjs.map +1 -1
- package/build/cjs/public/experimental.css +659 -29
- package/build/cjs/public/experimental.css.map +1 -1
- package/build/cjs/public/experimental.d.cts +435 -44
- package/build/esm/base-components/action-button/ActionButton.js +31 -0
- package/build/esm/base-components/action-button/ActionButton.js.map +1 -0
- package/build/esm/base-components/action-button/ActionButton.module.css +70 -0
- package/build/esm/base-components/checkbox/Checkbox.module.css +1 -1
- package/build/esm/base-components/combobox/Combobox.js +124 -0
- package/build/esm/base-components/combobox/Combobox.js.map +1 -0
- package/build/esm/base-components/combobox/Combobox.module.css +177 -0
- package/build/esm/base-components/dialog/Dialog.js +52 -0
- package/build/esm/base-components/dialog/Dialog.js.map +1 -0
- package/build/esm/base-components/dialog/Dialog.module.css +101 -0
- package/build/esm/base-components/draggable-list/DraggableList.js +155 -0
- package/build/esm/base-components/draggable-list/DraggableList.js.map +1 -0
- package/build/esm/base-components/draggable-list/DraggableList.module.css +108 -0
- package/build/esm/base-components/search-bar/SearchBar.js +44 -0
- package/build/esm/base-components/search-bar/SearchBar.js.map +1 -0
- package/build/esm/base-components/search-bar/SearchBar.module.css +53 -0
- package/build/esm/base-components/select/Select.js +89 -0
- package/build/esm/base-components/select/Select.js.map +1 -0
- package/build/esm/base-components/select/Select.module.css +138 -0
- package/build/esm/base-components/switch/Switch.js +33 -0
- package/build/esm/base-components/switch/Switch.js.map +1 -0
- package/build/esm/base-components/switch/Switch.module.css +91 -0
- package/build/esm/filter-list/FilterListApi.js.map +1 -1
- package/build/esm/filter-list/FilterListItemApi.js.map +1 -1
- package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js +296 -0
- package/build/esm/filter-list/__tests__/filterStateToWhereClause.test.js.map +1 -0
- package/build/esm/filter-list/__tests__/getFilterKey.test.js +53 -0
- package/build/esm/filter-list/__tests__/getFilterKey.test.js.map +1 -0
- package/build/esm/filter-list/__tests__/testUtils.js +192 -0
- package/build/esm/filter-list/__tests__/testUtils.js.map +1 -0
- package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js +128 -0
- package/build/esm/filter-list/hooks/__tests__/useFilterListState.test.js.map +1 -0
- package/build/esm/filter-list/hooks/useDebouncedValue.js +52 -0
- package/build/esm/filter-list/hooks/useDebouncedValue.js.map +1 -0
- package/build/esm/filter-list/hooks/useFilterListState.js +119 -0
- package/build/esm/filter-list/hooks/useFilterListState.js.map +1 -0
- package/build/esm/filter-list/hooks/usePropertyAggregation.js +92 -0
- package/build/esm/filter-list/hooks/usePropertyAggregation.js.map +1 -0
- package/build/esm/filter-list/types/AddFilterMenuTypes.js +2 -0
- package/build/esm/filter-list/types/AddFilterMenuTypes.js.map +1 -0
- package/build/esm/filter-list/types/CustomRendererTypes.js +2 -0
- package/build/esm/filter-list/types/CustomRendererTypes.js.map +1 -0
- package/build/esm/filter-list/types/KeywordSearchTypes.js +2 -0
- package/build/esm/filter-list/types/KeywordSearchTypes.js.map +1 -0
- package/build/esm/filter-list/types/LinkedFilterTypes.js +2 -0
- package/build/esm/filter-list/types/LinkedFilterTypes.js.map +1 -0
- package/build/esm/filter-list/types/index.js +21 -0
- package/build/esm/filter-list/types/index.js.map +1 -0
- package/build/esm/filter-list/utils/assertUnreachable.js +25 -0
- package/build/esm/filter-list/utils/assertUnreachable.js.map +1 -0
- package/build/esm/filter-list/utils/coerceFilterValue.js +33 -0
- package/build/esm/filter-list/utils/coerceFilterValue.js.map +1 -0
- package/build/esm/filter-list/utils/filterStateToWhereClause.js +337 -0
- package/build/esm/filter-list/utils/filterStateToWhereClause.js.map +1 -0
- package/build/esm/filter-list/utils/filterValues.js +55 -0
- package/build/esm/filter-list/utils/filterValues.js.map +1 -0
- package/build/esm/filter-list/utils/getFilterKey.js +34 -0
- package/build/esm/filter-list/utils/getFilterKey.js.map +1 -0
- package/build/esm/object-table/ColumnConfigDialog.js +259 -0
- package/build/esm/object-table/ColumnConfigDialog.js.map +1 -0
- package/build/esm/object-table/ColumnConfigDialog.module.css +247 -0
- package/build/esm/object-table/LoadingStateTable.js +4 -4
- package/build/esm/object-table/LoadingStateTable.js.map +1 -1
- package/build/esm/object-table/MultiColumnSortDialog.js +178 -0
- package/build/esm/object-table/MultiColumnSortDialog.js.map +1 -0
- package/build/esm/object-table/MultiColumnSortDialog.module.css +195 -0
- package/build/esm/object-table/NonIdealState.module.css +2 -3
- package/build/esm/object-table/ObjectTable.js +43 -13
- package/build/esm/object-table/ObjectTable.js.map +1 -1
- package/build/esm/object-table/ObjectTableApi.js.map +1 -1
- package/build/esm/object-table/SortableItemsList.js +35 -0
- package/build/esm/object-table/SortableItemsList.js.map +1 -0
- package/build/esm/object-table/Table.js +9 -7
- package/build/esm/object-table/Table.js.map +1 -1
- package/build/esm/object-table/Table.module.css +9 -2
- package/build/esm/object-table/TableCell.module.css +11 -0
- package/build/esm/object-table/TableHeader.js +93 -6
- package/build/esm/object-table/TableHeader.js.map +1 -1
- package/build/esm/object-table/TableHeader.module.css +7 -2
- package/build/esm/object-table/TableHeaderWithPopover.js +53 -22
- package/build/esm/object-table/TableHeaderWithPopover.js.map +1 -1
- package/build/esm/object-table/TableHeaderWithPopover.module.css +54 -23
- package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js +160 -138
- package/build/esm/object-table/hooks/__tests__/useColumnVisibility.test.js.map +1 -1
- package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js +3 -0
- package/build/esm/object-table/hooks/__tests__/useRowSelection.test.js.map +1 -1
- package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js +27 -82
- package/build/esm/object-table/hooks/__tests__/useSelectionColumn.test.js.map +1 -1
- package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js +290 -0
- package/build/esm/object-table/hooks/__tests__/useTableSorting.test.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnDefs.js +7 -2
- package/build/esm/object-table/hooks/useColumnDefs.js.map +1 -1
- package/build/esm/object-table/hooks/useColumnResize.js +45 -0
- package/build/esm/object-table/hooks/useColumnResize.js.map +1 -0
- package/build/esm/object-table/hooks/useColumnVisibility.js +52 -20
- package/build/esm/object-table/hooks/useColumnVisibility.js.map +1 -1
- package/build/esm/object-table/hooks/useRowSelection.js +8 -7
- package/build/esm/object-table/hooks/useRowSelection.js.map +1 -1
- package/build/esm/object-table/hooks/useSelectionColumn.js +15 -6
- package/build/esm/object-table/hooks/useSelectionColumn.js.map +1 -1
- package/build/esm/object-table/utils/types.js +2 -0
- package/build/esm/object-table/utils/types.js.map +1 -0
- package/build/esm/public/experimental.js +1 -0
- package/build/esm/public/experimental.js.map +1 -1
- package/build/types/base-components/action-button/ActionButton.d.ts +5 -0
- package/build/types/base-components/action-button/ActionButton.d.ts.map +1 -0
- package/build/types/base-components/combobox/Combobox.d.ts +52 -0
- package/build/types/base-components/combobox/Combobox.d.ts.map +1 -0
- package/build/types/base-components/dialog/Dialog.d.ts +10 -0
- package/build/types/base-components/dialog/Dialog.d.ts.map +1 -0
- package/build/types/base-components/draggable-list/DraggableList.d.ts +17 -0
- package/build/types/base-components/draggable-list/DraggableList.d.ts.map +1 -0
- package/build/types/base-components/search-bar/SearchBar.d.ts +11 -0
- package/build/types/base-components/search-bar/SearchBar.d.ts.map +1 -0
- package/build/types/base-components/select/Select.d.ts +34 -0
- package/build/types/base-components/select/Select.d.ts.map +1 -0
- package/build/types/base-components/switch/Switch.d.ts +10 -0
- package/build/types/base-components/switch/Switch.d.ts.map +1 -0
- package/build/types/filter-list/FilterListApi.d.ts +63 -12
- package/build/types/filter-list/FilterListApi.d.ts.map +1 -1
- package/build/types/filter-list/FilterListItemApi.d.ts +101 -53
- package/build/types/filter-list/FilterListItemApi.d.ts.map +1 -1
- package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts +1 -0
- package/build/types/filter-list/__tests__/filterStateToWhereClause.test.d.ts.map +1 -0
- package/build/types/filter-list/__tests__/getFilterKey.test.d.ts +1 -0
- package/build/types/filter-list/__tests__/getFilterKey.test.d.ts.map +1 -0
- package/build/types/filter-list/__tests__/testUtils.d.ts +59 -0
- package/build/types/filter-list/__tests__/testUtils.d.ts.map +1 -0
- package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts +1 -0
- package/build/types/filter-list/hooks/__tests__/useFilterListState.test.d.ts.map +1 -0
- package/build/types/filter-list/hooks/useDebouncedValue.d.ts +11 -0
- package/build/types/filter-list/hooks/useDebouncedValue.d.ts.map +1 -0
- package/build/types/filter-list/hooks/useFilterListState.d.ts +11 -0
- package/build/types/filter-list/hooks/useFilterListState.d.ts.map +1 -0
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts +20 -0
- package/build/types/filter-list/hooks/usePropertyAggregation.d.ts.map +1 -0
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts +61 -0
- package/build/types/filter-list/types/AddFilterMenuTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/CustomRendererTypes.d.ts +76 -0
- package/build/types/filter-list/types/CustomRendererTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/KeywordSearchTypes.d.ts +56 -0
- package/build/types/filter-list/types/KeywordSearchTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts +70 -0
- package/build/types/filter-list/types/LinkedFilterTypes.d.ts.map +1 -0
- package/build/types/filter-list/types/index.d.ts +4 -0
- package/build/types/filter-list/types/index.d.ts.map +1 -0
- package/build/types/filter-list/utils/assertUnreachable.d.ts +6 -0
- package/build/types/filter-list/utils/assertUnreachable.d.ts.map +1 -0
- package/build/types/filter-list/utils/coerceFilterValue.d.ts +11 -0
- package/build/types/filter-list/utils/coerceFilterValue.d.ts.map +1 -0
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts +16 -0
- package/build/types/filter-list/utils/filterStateToWhereClause.d.ts.map +1 -0
- package/build/types/filter-list/utils/filterValues.d.ts +5 -0
- package/build/types/filter-list/utils/filterValues.d.ts.map +1 -0
- package/build/types/filter-list/utils/getFilterKey.d.ts +3 -0
- package/build/types/filter-list/utils/getFilterKey.d.ts.map +1 -0
- package/build/types/object-table/ColumnConfigDialog.d.ts +18 -0
- package/build/types/object-table/ColumnConfigDialog.d.ts.map +1 -0
- package/build/types/object-table/LoadingStateTable.d.ts.map +1 -1
- package/build/types/object-table/MultiColumnSortDialog.d.ts +15 -0
- package/build/types/object-table/MultiColumnSortDialog.d.ts.map +1 -0
- package/build/types/object-table/ObjectTable.d.ts +1 -1
- package/build/types/object-table/ObjectTable.d.ts.map +1 -1
- package/build/types/object-table/ObjectTableApi.d.ts +41 -6
- package/build/types/object-table/ObjectTableApi.d.ts.map +1 -1
- package/build/types/object-table/SortableItemsList.d.ts +13 -0
- package/build/types/object-table/SortableItemsList.d.ts.map +1 -0
- package/build/types/object-table/Table.d.ts +12 -1
- package/build/types/object-table/Table.d.ts.map +1 -1
- package/build/types/object-table/TableHeader.d.ts +3 -1
- package/build/types/object-table/TableHeader.d.ts.map +1 -1
- package/build/types/object-table/TableHeaderWithPopover.d.ts +30 -6
- package/build/types/object-table/TableHeaderWithPopover.d.ts.map +1 -1
- package/build/types/object-table/hooks/useColumnResize.d.ts +10 -0
- package/build/types/object-table/hooks/useColumnResize.d.ts.map +1 -0
- package/build/types/object-table/hooks/useColumnVisibility.d.ts +18 -7
- package/build/types/object-table/hooks/useColumnVisibility.d.ts.map +1 -1
- package/build/types/object-table/hooks/useRowSelection.d.ts +5 -4
- package/build/types/object-table/hooks/useRowSelection.d.ts.map +1 -1
- package/build/types/object-table/utils/types.d.ts +5 -0
- package/build/types/object-table/utils/types.d.ts.map +1 -0
- package/build/types/public/experimental.d.ts +2 -0
- package/build/types/public/experimental.d.ts.map +1 -1
- package/package.json +16 -8
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Button } from "@base-ui/react/button";
|
|
19
|
+
import { DragHandleVertical, SmallCross, Trash } from "@blueprintjs/icons";
|
|
20
|
+
import { closestCenter, DndContext as BaseDndContext, KeyboardSensor, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
|
|
21
|
+
import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
22
|
+
import { CSS } from "@dnd-kit/utilities";
|
|
23
|
+
import classNames from "classnames";
|
|
24
|
+
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
25
|
+
import styles from "./DraggableList.module.css";
|
|
26
|
+
function DraggableListItem({
|
|
27
|
+
item,
|
|
28
|
+
onRemove,
|
|
29
|
+
removeIconVariant = "trash",
|
|
30
|
+
renderContent
|
|
31
|
+
}) {
|
|
32
|
+
const {
|
|
33
|
+
attributes,
|
|
34
|
+
listeners,
|
|
35
|
+
setNodeRef,
|
|
36
|
+
transform,
|
|
37
|
+
transition,
|
|
38
|
+
isDragging
|
|
39
|
+
} = useSortable({
|
|
40
|
+
id: item.id
|
|
41
|
+
});
|
|
42
|
+
const style = {
|
|
43
|
+
transform: CSS.Transform.toString(transform),
|
|
44
|
+
transition
|
|
45
|
+
};
|
|
46
|
+
const handleRemove = useCallback(() => {
|
|
47
|
+
onRemove?.(item.id);
|
|
48
|
+
}, [item.id, onRemove]);
|
|
49
|
+
const RemoveIcon = removeIconVariant === "trash" ? Trash : SmallCross;
|
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
51
|
+
ref: setNodeRef,
|
|
52
|
+
style: style,
|
|
53
|
+
className: styles.draggableItem,
|
|
54
|
+
"data-dragging": isDragging
|
|
55
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
56
|
+
className: styles.dragHandle,
|
|
57
|
+
"aria-label": `Reorder ${item.label}`
|
|
58
|
+
}, attributes, listeners), /*#__PURE__*/React.createElement(DragHandleVertical, {
|
|
59
|
+
className: styles.icon
|
|
60
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
61
|
+
className: styles.itemContent
|
|
62
|
+
}, renderContent ? renderContent(item) : item.label), onRemove && /*#__PURE__*/React.createElement(Button, {
|
|
63
|
+
className: styles.removeButton,
|
|
64
|
+
onClick: handleRemove,
|
|
65
|
+
"aria-label": `Remove ${item.label}`
|
|
66
|
+
}, /*#__PURE__*/React.createElement(RemoveIcon, {
|
|
67
|
+
className: styles.icon
|
|
68
|
+
})));
|
|
69
|
+
}
|
|
70
|
+
export function DraggableList({
|
|
71
|
+
items,
|
|
72
|
+
onReorder,
|
|
73
|
+
onRemove,
|
|
74
|
+
removeIconVariant = "cross",
|
|
75
|
+
renderContent,
|
|
76
|
+
emptyMessage,
|
|
77
|
+
className
|
|
78
|
+
}) {
|
|
79
|
+
const itemIds = useMemo(() => items.map(item => item.id), [items]);
|
|
80
|
+
const sensors = useSensors(useSensor(PointerSensor, {
|
|
81
|
+
activationConstraint: {
|
|
82
|
+
distance: 5
|
|
83
|
+
}
|
|
84
|
+
}), useSensor(KeyboardSensor, {
|
|
85
|
+
coordinateGetter: sortableKeyboardCoordinates
|
|
86
|
+
}));
|
|
87
|
+
const handleDragEnd = useCallback(event => {
|
|
88
|
+
const {
|
|
89
|
+
active,
|
|
90
|
+
over
|
|
91
|
+
} = event;
|
|
92
|
+
if (over && active.id !== over.id) {
|
|
93
|
+
const oldIndex = items.findIndex(item => item.id === active.id);
|
|
94
|
+
const newIndex = items.findIndex(item => item.id === over.id);
|
|
95
|
+
onReorder(oldIndex, newIndex);
|
|
96
|
+
}
|
|
97
|
+
}, [items, onReorder]);
|
|
98
|
+
const containerRef = useRef(null);
|
|
99
|
+
useKeyboardEvents(containerRef);
|
|
100
|
+
|
|
101
|
+
// TODO: Revert when @types/react is fixed
|
|
102
|
+
|
|
103
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
104
|
+
ref: containerRef,
|
|
105
|
+
className: classNames(styles.draggableListContainer, className)
|
|
106
|
+
}, /*#__PURE__*/React.createElement(BaseDndContext, {
|
|
107
|
+
sensors: sensors,
|
|
108
|
+
collisionDetection: closestCenter,
|
|
109
|
+
onDragEnd: handleDragEnd
|
|
110
|
+
}, /*#__PURE__*/React.createElement(SortableContext, {
|
|
111
|
+
items: itemIds,
|
|
112
|
+
strategy: verticalListSortingStrategy
|
|
113
|
+
}, items.map(item => /*#__PURE__*/React.createElement(DraggableListItem, {
|
|
114
|
+
key: item.id,
|
|
115
|
+
item: item,
|
|
116
|
+
onRemove: onRemove,
|
|
117
|
+
removeIconVariant: removeIconVariant,
|
|
118
|
+
renderContent: renderContent
|
|
119
|
+
})))), items.length === 0 && emptyMessage && /*#__PURE__*/React.createElement("div", {
|
|
120
|
+
className: styles.emptyState
|
|
121
|
+
}, emptyMessage));
|
|
122
|
+
}
|
|
123
|
+
const useKeyboardEvents = containerRef => {
|
|
124
|
+
// Base UI's DialogPopup calls stopPropagation on arrow key events, which
|
|
125
|
+
// prevents them from reaching @dnd-kit's document-level KeyboardSensor
|
|
126
|
+
// listener. We use a native capture-phase listener to intercept arrow keys
|
|
127
|
+
// before the dialog can swallow them, and re-dispatch them on the document
|
|
128
|
+
// so @dnd-kit can process keyboard-driven reordering.
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
const el = containerRef.current;
|
|
131
|
+
if (el == null) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const ARROW_KEYS = new Set(["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"]);
|
|
135
|
+
function handleCapture(event) {
|
|
136
|
+
if (!ARROW_KEYS.has(event.key)) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Only intercept when a drag is active (an item has [data-dragging="true"])
|
|
141
|
+
if (el.querySelector("[data-dragging=\"true\"]") == null) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
event.stopPropagation();
|
|
145
|
+
document.dispatchEvent(new KeyboardEvent("keydown", {
|
|
146
|
+
key: event.key,
|
|
147
|
+
code: event.code,
|
|
148
|
+
bubbles: true
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
el.addEventListener("keydown", handleCapture, true);
|
|
152
|
+
return () => el.removeEventListener("keydown", handleCapture, true);
|
|
153
|
+
}, [containerRef]);
|
|
154
|
+
};
|
|
155
|
+
//# sourceMappingURL=DraggableList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DraggableList.js","names":["Button","DragHandleVertical","SmallCross","Trash","closestCenter","DndContext","BaseDndContext","KeyboardSensor","PointerSensor","useSensor","useSensors","SortableContext","sortableKeyboardCoordinates","useSortable","verticalListSortingStrategy","CSS","classNames","React","useCallback","useEffect","useMemo","useRef","styles","DraggableListItem","item","onRemove","removeIconVariant","renderContent","attributes","listeners","setNodeRef","transform","transition","isDragging","id","style","Transform","toString","handleRemove","RemoveIcon","createElement","ref","className","draggableItem","_extends","dragHandle","label","icon","itemContent","removeButton","onClick","DraggableList","items","onReorder","emptyMessage","itemIds","map","sensors","activationConstraint","distance","coordinateGetter","handleDragEnd","event","active","over","oldIndex","findIndex","newIndex","containerRef","useKeyboardEvents","draggableListContainer","collisionDetection","onDragEnd","strategy","key","length","emptyState","el","current","ARROW_KEYS","Set","handleCapture","has","querySelector","stopPropagation","document","dispatchEvent","KeyboardEvent","code","bubbles","addEventListener","removeEventListener"],"sources":["DraggableList.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Button } from \"@base-ui/react/button\";\nimport { DragHandleVertical, SmallCross, Trash } from \"@blueprintjs/icons\";\nimport {\n closestCenter,\n DndContext as BaseDndContext,\n type DragEndEvent,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport {\n SortableContext,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport classNames from \"classnames\";\nimport type { RefObject } from \"react\";\nimport React, { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport styles from \"./DraggableList.module.css\";\n\nexport interface DraggableItem {\n id: string;\n label: string;\n}\n\ntype RemoveIconVariant = \"trash\" | \"cross\";\n\ninterface DraggableListItemProps<T extends DraggableItem> {\n item: T;\n onRemove?: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n}\n\nfunction DraggableListItem<T extends DraggableItem>({\n item,\n onRemove,\n removeIconVariant = \"trash\",\n renderContent,\n}: DraggableListItemProps<T>): React.ReactElement {\n const {\n attributes,\n listeners,\n setNodeRef,\n transform,\n transition,\n isDragging,\n } = useSortable({ id: item.id });\n\n const style = {\n transform: CSS.Transform.toString(transform),\n transition,\n };\n\n const handleRemove = useCallback(() => {\n onRemove?.(item.id);\n }, [item.id, onRemove]);\n\n const RemoveIcon = removeIconVariant === \"trash\" ? Trash : SmallCross;\n\n return (\n <div\n ref={setNodeRef}\n style={style}\n className={styles.draggableItem}\n data-dragging={isDragging}\n >\n <div\n className={styles.dragHandle}\n aria-label={`Reorder ${item.label}`}\n {...attributes}\n {...listeners}\n >\n <DragHandleVertical className={styles.icon} />\n </div>\n <div className={styles.itemContent}>\n {renderContent ? renderContent(item) : item.label}\n </div>\n {onRemove && (\n <Button\n className={styles.removeButton}\n onClick={handleRemove}\n aria-label={`Remove ${item.label}`}\n >\n <RemoveIcon className={styles.icon} />\n </Button>\n )}\n </div>\n );\n}\n\nexport interface DraggableListProps<T extends DraggableItem> {\n items: T[];\n onReorder: (fromIndex: number, toIndex: number) => void;\n onRemove: (id: string) => void;\n removeIconVariant?: RemoveIconVariant;\n renderContent?: (item: T) => React.ReactNode;\n emptyMessage?: string;\n className?: string;\n}\n\nexport function DraggableList<T extends DraggableItem>({\n items,\n onReorder,\n onRemove,\n removeIconVariant = \"cross\",\n renderContent,\n emptyMessage,\n className,\n}: DraggableListProps<T>): React.ReactElement {\n const itemIds = useMemo(() => items.map((item) => item.id), [items]);\n const sensors = useSensors(\n useSensor(PointerSensor, {\n activationConstraint: {\n distance: 5,\n },\n }),\n useSensor(KeyboardSensor, {\n coordinateGetter: sortableKeyboardCoordinates,\n }),\n );\n\n const handleDragEnd = useCallback(\n (event: DragEndEvent) => {\n const { active, over } = event;\n\n if (over && active.id !== over.id) {\n const oldIndex = items.findIndex((item) => item.id === active.id);\n const newIndex = items.findIndex((item) => item.id === over.id);\n onReorder(oldIndex, newIndex);\n }\n },\n [items, onReorder],\n );\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useKeyboardEvents(containerRef);\n\n // TODO: Revert when @types/react is fixed\n const DndContext = BaseDndContext as any;\n\n return (\n <div\n ref={containerRef}\n className={classNames(styles.draggableListContainer, className)}\n >\n <DndContext\n sensors={sensors}\n collisionDetection={closestCenter}\n onDragEnd={handleDragEnd}\n >\n <SortableContext\n items={itemIds}\n strategy={verticalListSortingStrategy}\n >\n {items.map((item) => (\n <DraggableListItem<T>\n key={item.id}\n item={item}\n onRemove={onRemove}\n removeIconVariant={removeIconVariant}\n renderContent={renderContent}\n />\n ))}\n </SortableContext>\n </DndContext>\n {items.length === 0 && emptyMessage && (\n <div className={styles.emptyState}>{emptyMessage}</div>\n )}\n </div>\n );\n}\n\nconst useKeyboardEvents = (containerRef: RefObject<HTMLDivElement>) => {\n // Base UI's DialogPopup calls stopPropagation on arrow key events, which\n // prevents them from reaching @dnd-kit's document-level KeyboardSensor\n // listener. We use a native capture-phase listener to intercept arrow keys\n // before the dialog can swallow them, and re-dispatch them on the document\n // so @dnd-kit can process keyboard-driven reordering.\n useEffect(() => {\n const el = containerRef.current;\n if (el == null) {\n return;\n }\n\n const ARROW_KEYS = new Set([\n \"ArrowUp\",\n \"ArrowDown\",\n \"ArrowLeft\",\n \"ArrowRight\",\n ]);\n\n function handleCapture(event: KeyboardEvent) {\n if (!ARROW_KEYS.has(event.key)) {\n return;\n }\n\n // Only intercept when a drag is active (an item has [data-dragging=\"true\"])\n if (el!.querySelector(\"[data-dragging=\\\"true\\\"]\") == null) {\n return;\n }\n\n event.stopPropagation();\n\n document.dispatchEvent(\n new KeyboardEvent(\"keydown\", {\n key: event.key,\n code: event.code,\n bubbles: true,\n }),\n );\n }\n\n el.addEventListener(\"keydown\", handleCapture, true);\n return () => el.removeEventListener(\"keydown\", handleCapture, true);\n }, [containerRef]);\n};\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,kBAAkB,EAAEC,UAAU,EAAEC,KAAK,QAAQ,oBAAoB;AAC1E,SACEC,aAAa,EACbC,UAAU,IAAIC,cAAc,EAE5BC,cAAc,EACdC,aAAa,EACbC,SAAS,EACTC,UAAU,QACL,eAAe;AACtB,SACEC,eAAe,EACfC,2BAA2B,EAC3BC,WAAW,EACXC,2BAA2B,QACtB,mBAAmB;AAC1B,SAASC,GAAG,QAAQ,oBAAoB;AACxC,OAAOC,UAAU,MAAM,YAAY;AAEnC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE,OAAOC,MAAM,MAAM,4BAA4B;AAgB/C,SAASC,iBAAiBA,CAA0B;EAClDC,IAAI;EACJC,QAAQ;EACRC,iBAAiB,GAAG,OAAO;EAC3BC;AACyB,CAAC,EAAsB;EAChD,MAAM;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC;EACF,CAAC,GAAGpB,WAAW,CAAC;IAAEqB,EAAE,EAAEV,IAAI,CAACU;EAAG,CAAC,CAAC;EAEhC,MAAMC,KAAK,GAAG;IACZJ,SAAS,EAAEhB,GAAG,CAACqB,SAAS,CAACC,QAAQ,CAACN,SAAS,CAAC;IAC5CC;EACF,CAAC;EAED,MAAMM,YAAY,GAAGpB,WAAW,CAAC,MAAM;IACrCO,QAAQ,GAAGD,IAAI,CAACU,EAAE,CAAC;EACrB,CAAC,EAAE,CAACV,IAAI,CAACU,EAAE,EAAET,QAAQ,CAAC,CAAC;EAEvB,MAAMc,UAAU,GAAGb,iBAAiB,KAAK,OAAO,GA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C;EACrE,CAAC,EAAE,CAACb,YAAY,CAAC,CAAC;AACpB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.draggableListContainer {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: var(--osdk-draggable-item-gap);
|
|
21
|
+
overflow-y: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.draggableItem {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
gap: var(--osdk-draggable-item-gap);
|
|
28
|
+
padding: var(--osdk-draggable-item-padding);
|
|
29
|
+
background-color: var(--osdk-draggable-item-bg);
|
|
30
|
+
border: var(--osdk-draggable-item-border);
|
|
31
|
+
border-radius: var(--osdk-draggable-item-border-radius);
|
|
32
|
+
width: 100%;
|
|
33
|
+
touch-action: none;
|
|
34
|
+
user-select: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.draggableItem[data-dragging="true"] {
|
|
38
|
+
opacity: 0.5;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.dragHandle {
|
|
42
|
+
display: flex;
|
|
43
|
+
cursor: grab;
|
|
44
|
+
color: var(--osdk-draggable-item-drag-icon-color);
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
color: var(--osdk-draggable-item-drag-icon-color-hover);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:active {
|
|
51
|
+
cursor: grabbing;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:focus {
|
|
55
|
+
outline: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:focus-visible {
|
|
59
|
+
outline: var(--osdk-focus-outline);
|
|
60
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.itemContent {
|
|
65
|
+
flex: 1;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
text-overflow: ellipsis;
|
|
68
|
+
white-space: nowrap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.removeButton {
|
|
72
|
+
background: none;
|
|
73
|
+
border: none;
|
|
74
|
+
padding: var(--osdk-surface-spacing);
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
display: flex;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
color: var(--osdk-draggable-item-drag-icon-color);
|
|
80
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
81
|
+
|
|
82
|
+
&:hover {
|
|
83
|
+
color: var(--osdk-typography-color-danger-rest);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&:active {
|
|
87
|
+
color: var(--osdk-typography-color-danger-rest);
|
|
88
|
+
background: oklch(
|
|
89
|
+
from var(--osdk-surface-background-color-danger-hover) l c h / 0.2
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&:focus {
|
|
94
|
+
outline: none;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:focus-visible {
|
|
98
|
+
outline: var(--osdk-focus-outline);
|
|
99
|
+
outline-offset: var(--osdk-focus-visible-outline-offset);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.emptyState {
|
|
104
|
+
padding: calc(var(--osdk-surface-spacing) * 5);
|
|
105
|
+
text-align: center;
|
|
106
|
+
color: var(--osdk-typography-color-muted);
|
|
107
|
+
font-style: italic;
|
|
108
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { Input } from "@base-ui/react/input";
|
|
18
|
+
import { Search } from "@blueprintjs/icons";
|
|
19
|
+
import classNames from "classnames";
|
|
20
|
+
import React from "react";
|
|
21
|
+
import styles from "./SearchBar.module.css";
|
|
22
|
+
export function SearchBar({
|
|
23
|
+
value,
|
|
24
|
+
onChange,
|
|
25
|
+
placeholder = "Search",
|
|
26
|
+
"aria-label": ariaLabel,
|
|
27
|
+
className,
|
|
28
|
+
onKeyDown
|
|
29
|
+
}) {
|
|
30
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
31
|
+
className: classNames(styles.searchBar, className)
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
33
|
+
className: styles.searchIcon
|
|
34
|
+
}), /*#__PURE__*/React.createElement(Input, {
|
|
35
|
+
type: "text",
|
|
36
|
+
placeholder: placeholder,
|
|
37
|
+
"aria-label": ariaLabel ?? placeholder,
|
|
38
|
+
value: value,
|
|
39
|
+
onChange: onChange,
|
|
40
|
+
className: styles.searchInput,
|
|
41
|
+
onKeyDown: onKeyDown
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=SearchBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchBar.js","names":["Input","Search","classNames","React","styles","SearchBar","value","onChange","placeholder","ariaLabel","className","onKeyDown","createElement","searchBar","searchIcon","type","searchInput"],"sources":["SearchBar.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Input } from \"@base-ui/react/input\";\nimport { Search } from \"@blueprintjs/icons\";\nimport classNames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./SearchBar.module.css\";\n\ninterface SearchBarProps {\n value: string;\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\n placeholder?: string;\n \"aria-label\"?: string;\n className?: string;\n onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;\n}\n\nexport function SearchBar({\n value,\n onChange,\n placeholder = \"Search\",\n \"aria-label\": ariaLabel,\n className,\n onKeyDown,\n}: SearchBarProps): React.ReactElement {\n return (\n <div className={classNames(styles.searchBar, className)}>\n <Search className={styles.searchIcon} />\n <Input\n type=\"text\"\n placeholder={placeholder}\n aria-label={ariaLabel ?? placeholder}\n value={value}\n onChange={onChange}\n className={styles.searchInput}\n onKeyDown={onKeyDown}\n />\n </div>\n );\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,sBAAsB;AAC5C,SAASC,MAAM,QAAQ,oBAAoB;AAC3C,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,MAAM,MAAM,wBAAwB;AAW3C,OAAO,SAASC,SAASA,CAAC;EACxBC,KAAK;EACLC,QAAQ;EACRC,WAAW,GAAG,QAAQ;EACtB,YAAY,EAAEC,SAAS;EACvBC,SAAS;EACTC;AACc,CAAC,EAAsB;EACrC,oBACER,KAAA,CAAAS,aAAA;IAAKF,SAAS,EAAER,UAAU,CAACE,MAAM,CAACS,SAAS,EAAEH,SAAS;EAAE,gBACtDP,KAAA,CAAAS,aAAA,CAACX,MAAM;IAACS,SAAS,EAAEN,MAAM,CAACU;EAAW,CAAE,CAAC,eACxCX,KAAA,CAAAS,aAAA,CAACZ,KAAK;IACJe,IAAI,EAAC,MAAM;IACXP,WAAW,EAAEA,WAAY;IACzB,cAAYC,SAAS,IAAID,WAAY;IACrCF,KAAK,EAAEA,KAAM;IACbC,QAAQ,EAAEA,QAAS;IACnBG,SAAS,EAAEN,MAAM,CAACY,WAAY;IAC9BL,SAAS,EAAEA;EAAU,CACtB,CACE,CAAC;AAEV","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.searchBar {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--osdk-surface-spacing);
|
|
21
|
+
padding: var(--osdk-surface-spacing) calc(var(--osdk-surface-spacing) * 1.5);
|
|
22
|
+
border: var(--osdk-surface-border);
|
|
23
|
+
border-radius: var(--osdk-surface-border-radius);
|
|
24
|
+
|
|
25
|
+
&:focus-within {
|
|
26
|
+
outline: var(--osdk-focus-outline);
|
|
27
|
+
outline-offset: calc(-1 * var(--osdk-focus-visible-outline-offset));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.searchIcon {
|
|
32
|
+
width: var(--osdk-iconography-size-small);
|
|
33
|
+
height: var(--osdk-iconography-size-small);
|
|
34
|
+
color: var(--osdk-typography-color-muted);
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.searchInput {
|
|
40
|
+
border: none;
|
|
41
|
+
width: 100%;
|
|
42
|
+
padding: var(--osdk-surface-spacing) 0;
|
|
43
|
+
font-size: var(--osdk-typography-size-body-medium);
|
|
44
|
+
background: transparent;
|
|
45
|
+
|
|
46
|
+
&:focus {
|
|
47
|
+
outline: none;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&::placeholder {
|
|
51
|
+
color: var(--osdk-typography-color-muted);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { Select as BaseUISelect } from "@base-ui/react/select";
|
|
19
|
+
import { CaretDown } from "@blueprintjs/icons";
|
|
20
|
+
import classnames from "classnames";
|
|
21
|
+
import React from "react";
|
|
22
|
+
import styles from "./Select.module.css";
|
|
23
|
+
function SelectRoot({
|
|
24
|
+
children,
|
|
25
|
+
...rest
|
|
26
|
+
}) {
|
|
27
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Root, rest, children);
|
|
28
|
+
}
|
|
29
|
+
function SelectTrigger({
|
|
30
|
+
className,
|
|
31
|
+
placeholder,
|
|
32
|
+
children,
|
|
33
|
+
...rest
|
|
34
|
+
}) {
|
|
35
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Trigger, _extends({
|
|
36
|
+
className: classnames(styles.osdkSelectTrigger, className)
|
|
37
|
+
}, rest), children ?? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BaseUISelect.Value, null, value => value != null ? String(value) : placeholder), /*#__PURE__*/React.createElement(BaseUISelect.Icon, {
|
|
38
|
+
className: styles.osdkSelectIcon
|
|
39
|
+
}, /*#__PURE__*/React.createElement(CaretDown, {
|
|
40
|
+
color: "currentColor"
|
|
41
|
+
}))));
|
|
42
|
+
}
|
|
43
|
+
function SelectValue(props) {
|
|
44
|
+
const {
|
|
45
|
+
className,
|
|
46
|
+
...rest
|
|
47
|
+
} = props;
|
|
48
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Value, _extends({
|
|
49
|
+
className: classnames(styles.osdkSelectValue, className)
|
|
50
|
+
}, rest));
|
|
51
|
+
}
|
|
52
|
+
function SelectPositioner({
|
|
53
|
+
className,
|
|
54
|
+
children,
|
|
55
|
+
...rest
|
|
56
|
+
}) {
|
|
57
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Positioner, _extends({
|
|
58
|
+
className: classnames(styles.osdkSelectPositioner, className),
|
|
59
|
+
sideOffset: 4
|
|
60
|
+
}, rest), children);
|
|
61
|
+
}
|
|
62
|
+
function SelectPopup({
|
|
63
|
+
className,
|
|
64
|
+
children,
|
|
65
|
+
...rest
|
|
66
|
+
}) {
|
|
67
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Popup, _extends({
|
|
68
|
+
className: classnames(styles.osdkSelectPopup, className)
|
|
69
|
+
}, rest), children);
|
|
70
|
+
}
|
|
71
|
+
function SelectItem({
|
|
72
|
+
className,
|
|
73
|
+
children,
|
|
74
|
+
...rest
|
|
75
|
+
}) {
|
|
76
|
+
return /*#__PURE__*/React.createElement(BaseUISelect.Item, _extends({
|
|
77
|
+
className: classnames(styles.osdkSelectItem, className)
|
|
78
|
+
}, rest), /*#__PURE__*/React.createElement(BaseUISelect.ItemText, null, children));
|
|
79
|
+
}
|
|
80
|
+
export const Select = {
|
|
81
|
+
Root: SelectRoot,
|
|
82
|
+
Trigger: SelectTrigger,
|
|
83
|
+
Value: SelectValue,
|
|
84
|
+
Portal: BaseUISelect.Portal,
|
|
85
|
+
Positioner: SelectPositioner,
|
|
86
|
+
Popup: SelectPopup,
|
|
87
|
+
Item: SelectItem
|
|
88
|
+
};
|
|
89
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.js","names":["Select","BaseUISelect","CaretDown","classnames","React","styles","SelectRoot","children","rest","createElement","Root","SelectTrigger","className","placeholder","Trigger","_extends","osdkSelectTrigger","Fragment","Value","value","String","Icon","osdkSelectIcon","color","SelectValue","props","osdkSelectValue","SelectPositioner","Positioner","osdkSelectPositioner","sideOffset","SelectPopup","Popup","osdkSelectPopup","SelectItem","Item","osdkSelectItem","ItemText","Portal"],"sources":["Select.tsx"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Select as BaseUISelect,\n type SelectItemProps,\n type SelectPopupProps,\n type SelectPositionerProps,\n type SelectRootProps,\n type SelectTriggerProps,\n type SelectValueProps,\n} from \"@base-ui/react/select\";\nimport { CaretDown } from \"@blueprintjs/icons\";\nimport classnames from \"classnames\";\nimport React from \"react\";\nimport styles from \"./Select.module.css\";\n\nexport interface SelectProps<Value extends string | number>\n extends Omit<SelectRootProps<Value, false>, \"className\" | \"multiple\">\n{}\n\nfunction SelectRoot<Value extends string | number>({\n children,\n ...rest\n}: SelectProps<Value>): React.ReactElement {\n return (\n <BaseUISelect.Root<Value> {...rest}>\n {children}\n </BaseUISelect.Root>\n );\n}\n\ninterface SelectTriggerComponentProps\n extends Omit<SelectTriggerProps, \"className\">\n{\n className?: string;\n placeholder?: string;\n}\n\nfunction SelectTrigger({\n className,\n placeholder,\n children,\n ...rest\n}: SelectTriggerComponentProps): React.ReactElement {\n return (\n <BaseUISelect.Trigger\n className={classnames(styles.osdkSelectTrigger, className)}\n {...rest}\n >\n {children ?? (\n <>\n <BaseUISelect.Value>\n {(value) => (value != null ? String(value) : placeholder)}\n </BaseUISelect.Value>\n <BaseUISelect.Icon className={styles.osdkSelectIcon}>\n <CaretDown color=\"currentColor\" />\n </BaseUISelect.Icon>\n </>\n )}\n </BaseUISelect.Trigger>\n );\n}\n\nfunction SelectValue(\n props: Omit<SelectValueProps, \"className\"> & { className?: string },\n): React.ReactElement {\n const { className, ...rest } = props;\n return (\n <BaseUISelect.Value\n className={classnames(styles.osdkSelectValue, className)}\n {...rest}\n />\n );\n}\n\ninterface SelectPositionerComponentProps\n extends Omit<SelectPositionerProps, \"className\">\n{\n className?: string;\n}\n\nfunction SelectPositioner({\n className,\n children,\n ...rest\n}: SelectPositionerComponentProps): React.ReactElement {\n return (\n <BaseUISelect.Positioner\n className={classnames(styles.osdkSelectPositioner, className)}\n sideOffset={4}\n {...rest}\n >\n {children}\n </BaseUISelect.Positioner>\n );\n}\n\ninterface SelectPopupComponentProps\n extends Omit<SelectPopupProps, \"className\">\n{\n className?: string;\n}\n\nfunction SelectPopup({\n className,\n children,\n ...rest\n}: SelectPopupComponentProps): React.ReactElement {\n return (\n <BaseUISelect.Popup\n className={classnames(styles.osdkSelectPopup, className)}\n {...rest}\n >\n {children}\n </BaseUISelect.Popup>\n );\n}\n\ninterface SelectItemComponentProps extends Omit<SelectItemProps, \"className\"> {\n className?: string;\n}\n\nfunction SelectItem({\n className,\n children,\n ...rest\n}: SelectItemComponentProps): React.ReactElement {\n return (\n <BaseUISelect.Item\n className={classnames(styles.osdkSelectItem, className)}\n {...rest}\n >\n <BaseUISelect.ItemText>{children}</BaseUISelect.ItemText>\n </BaseUISelect.Item>\n );\n}\n\nexport const Select: {\n Root: typeof SelectRoot;\n Trigger: typeof SelectTrigger;\n Value: typeof SelectValue;\n Portal: typeof BaseUISelect.Portal;\n Positioner: typeof SelectPositioner;\n Popup: typeof SelectPopup;\n Item: typeof SelectItem;\n} = {\n Root: SelectRoot,\n Trigger: SelectTrigger,\n Value: SelectValue,\n Portal: BaseUISelect.Portal,\n Positioner: SelectPositioner,\n Popup: SelectPopup,\n Item: SelectItem,\n};\n"],"mapp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EAAED,WAAW;EAClBI,IAAI,EAAED;AACR,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
.osdkSelectTrigger {
|
|
18
|
+
display: inline-flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
justify-content: space-between;
|
|
21
|
+
gap: var(--osdk-select-spacing, var(--bp-surface-spacing));
|
|
22
|
+
width: 100%;
|
|
23
|
+
min-height: 30px;
|
|
24
|
+
padding: calc(var(--osdk-select-spacing, var(--bp-surface-spacing)) * 1.5)
|
|
25
|
+
calc(var(--osdk-select-spacing, var(--bp-surface-spacing)) * 2.5);
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
border-radius: var(--osdk-select-border-radius, var(--bp-surface-borderRadius));
|
|
29
|
+
border: var(--osdk-select-border-width, var(--bp-surface-borderWidth)) solid
|
|
30
|
+
var(--osdk-select-border-color, var(--bp-surface-borderColor-default));
|
|
31
|
+
background-color: var(--osdk-select-trigger-bg, var(--bp-surface-colorRest-default));
|
|
32
|
+
color: var(--osdk-select-trigger-color, var(--bp-typography-colorRest-default));
|
|
33
|
+
font-family: var(--osdk-select-font-family, var(--bp-typography-family-default));
|
|
34
|
+
font-size: var(--osdk-select-font-size, var(--bp-typography-size-bodyMedium));
|
|
35
|
+
line-height: var(--osdk-select-line-height, var(--bp-typography-lineHeight-default));
|
|
36
|
+
transition: background-color var(--osdk-select-transition-duration, var(--bp-emphasis-transitionDuration))
|
|
37
|
+
var(--osdk-select-transition-ease, var(--bp-emphasis-ease-default)),
|
|
38
|
+
border-color var(--osdk-select-transition-duration, var(--bp-emphasis-transitionDuration))
|
|
39
|
+
var(--osdk-select-transition-ease, var(--bp-emphasis-ease-default));
|
|
40
|
+
|
|
41
|
+
&:hover {
|
|
42
|
+
background-color: var(--osdk-select-trigger-bg-hover, var(--bp-surface-colorHover-default));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&:active {
|
|
46
|
+
background-color: var(--osdk-select-trigger-bg-active, var(--bp-surface-colorActive-default));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus-visible {
|
|
50
|
+
outline: var(--osdk-select-focus-width, var(--bp-emphasis-focusWidth)) solid
|
|
51
|
+
var(--osdk-select-focus-color, var(--bp-emphasis-focusColor));
|
|
52
|
+
outline-offset: var(--osdk-select-focus-offset, var(--bp-emphasis-focusOffset));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&[data-disabled] {
|
|
56
|
+
cursor: not-allowed;
|
|
57
|
+
opacity: 0.5;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&[data-popup-open] {
|
|
61
|
+
border-color: var(--osdk-select-border-color-active, var(--bp-intent-primary-rest));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.osdkSelectValue {
|
|
66
|
+
flex: 1;
|
|
67
|
+
text-align: left;
|
|
68
|
+
overflow: hidden;
|
|
69
|
+
text-overflow: ellipsis;
|
|
70
|
+
white-space: nowrap;
|
|
71
|
+
|
|
72
|
+
&[data-placeholder] {
|
|
73
|
+
color: var(--osdk-select-placeholder-color, var(--bp-typography-colorMuted));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.osdkSelectIcon {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
color: var(--osdk-select-icon-color, var(--bp-iconography-colorMuted));
|
|
82
|
+
flex-shrink: 0;
|
|
83
|
+
transition: transform var(--osdk-select-transition-duration, var(--bp-emphasis-transitionDuration))
|
|
84
|
+
var(--osdk-select-transition-ease, var(--bp-emphasis-ease-default));
|
|
85
|
+
|
|
86
|
+
[data-popup-open] > & {
|
|
87
|
+
transform: rotate(180deg);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.osdkSelectPositioner {
|
|
92
|
+
z-index: var(--osdk-select-z-index, var(--bp-surface-zIndex-3));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.osdkSelectPopup {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
min-width: var(--anchor-width);
|
|
99
|
+
max-height: var(--available-height);
|
|
100
|
+
overflow-y: auto;
|
|
101
|
+
padding: calc(var(--osdk-select-spacing, var(--bp-surface-spacing)) * 1.5);
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
border-radius: var(--osdk-select-border-radius, var(--bp-surface-borderRadius));
|
|
104
|
+
border: var(--osdk-select-border-width, var(--bp-surface-borderWidth)) solid
|
|
105
|
+
var(--osdk-select-border-color, var(--bp-surface-borderColor-default));
|
|
106
|
+
background-color: var(--osdk-select-popup-bg, var(--bp-surface-colorRest-default));
|
|
107
|
+
box-shadow: var(--osdk-select-popup-shadow, var(--bp-surface-shadow-2));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.osdkSelectItem {
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
padding: calc(var(--osdk-select-spacing, var(--bp-surface-spacing)) * 1.5)
|
|
114
|
+
calc(var(--osdk-select-spacing, var(--bp-surface-spacing)) * 2);
|
|
115
|
+
border-radius: var(--osdk-select-border-radius, var(--bp-surface-borderRadius));
|
|
116
|
+
cursor: pointer;
|
|
117
|
+
font-family: var(--osdk-select-font-family, var(--bp-typography-family-default));
|
|
118
|
+
font-size: var(--osdk-select-font-size, var(--bp-typography-size-bodyMedium));
|
|
119
|
+
line-height: var(--osdk-select-line-height, var(--bp-typography-lineHeight-default));
|
|
120
|
+
color: var(--osdk-select-item-color, var(--bp-typography-colorRest-default));
|
|
121
|
+
transition: background-color var(--osdk-select-transition-duration, var(--bp-emphasis-transitionDuration))
|
|
122
|
+
var(--osdk-select-transition-ease, var(--bp-emphasis-ease-default));
|
|
123
|
+
|
|
124
|
+
&[data-highlighted] {
|
|
125
|
+
background-color: var(--osdk-select-item-bg-highlighted, var(--bp-surface-colorHover-default));
|
|
126
|
+
outline: none;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
&[data-selected] {
|
|
130
|
+
background-color: var(--osdk-select-item-bg-selected, var(--bp-surface-depthLayer-primary));
|
|
131
|
+
color: var(--osdk-select-item-color-selected, var(--bp-intent-primary-rest));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&[data-disabled] {
|
|
135
|
+
cursor: not-allowed;
|
|
136
|
+
opacity: 0.5;
|
|
137
|
+
}
|
|
138
|
+
}
|