@camstack/ui-library 1.2.279 → 1.2.281

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.
@@ -22,4 +22,4 @@ export interface DataTableFilter<T> {
22
22
  * read before it says "there is nothing here". */
23
23
  readonly active: boolean;
24
24
  }
25
- export declare function useDataTableFilter<T>(rows: readonly T[], config: DataTableFilterConfig<T>): DataTableFilter<T>;
25
+ export declare function useDataTableFilter<T>(rows: readonly T[], config: DataTableFilterConfig<T>, initialState?: DataTableFilterState): DataTableFilter<T>;
package/dist/index.cjs CHANGED
@@ -32124,7 +32124,7 @@ function TabsTrigger({ value, className, ...props }) {
32124
32124
  "aria-selected": isActive,
32125
32125
  "aria-controls": `tabpanel-${value}`,
32126
32126
  tabIndex: isActive ? 0 : -1,
32127
- className: cn("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", appearance === "pills" ? isActive ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : isActive ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", className),
32127
+ className: cn("inline-flex h-7 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap text-xs px-3 transition-colors", appearance === "pills" ? isActive ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : isActive ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", className),
32128
32128
  onClick: () => setValue(value),
32129
32129
  ...props
32130
32130
  });
@@ -38613,8 +38613,8 @@ function DataTableFilterBar({ state, facets, labels, onSearch, onToggleFacet, on
38613
38613
  * anything that acts on "the rows on screen" — a select-all, a bulk action —
38614
38614
  * must act on exactly these and nothing the filter hid.
38615
38615
  */
38616
- function useDataTableFilter(rows, config) {
38617
- const [state, setState] = (0, react$1.useState)(EMPTY_DATA_TABLE_FILTER);
38616
+ function useDataTableFilter(rows, config, initialState = EMPTY_DATA_TABLE_FILTER) {
38617
+ const [state, setState] = (0, react$1.useState)(initialState);
38618
38618
  const setSearch = (0, react$1.useCallback)((search) => {
38619
38619
  setState((prev) => ({
38620
38620
  ...prev,
package/dist/index.js CHANGED
@@ -32100,7 +32100,7 @@ function TabsTrigger({ value, className, ...props }) {
32100
32100
  "aria-selected": isActive,
32101
32101
  "aria-controls": `tabpanel-${value}`,
32102
32102
  tabIndex: isActive ? 0 : -1,
32103
- className: cn("h-7 shrink-0 whitespace-nowrap text-xs px-3 transition-colors", appearance === "pills" ? isActive ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : isActive ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", className),
32103
+ className: cn("inline-flex h-7 shrink-0 items-center justify-center gap-1.5 whitespace-nowrap text-xs px-3 transition-colors", appearance === "pills" ? isActive ? "rounded-md bg-primary/10 font-medium text-primary" : "rounded-md text-foreground-muted hover:bg-surface-hover hover:text-foreground" : isActive ? "border-b-2 border-primary text-foreground font-medium" : "text-foreground-muted hover:text-foreground", className),
32104
32104
  onClick: () => setValue(value),
32105
32105
  ...props
32106
32106
  });
@@ -38589,8 +38589,8 @@ function DataTableFilterBar({ state, facets, labels, onSearch, onToggleFacet, on
38589
38589
  * anything that acts on "the rows on screen" — a select-all, a bulk action —
38590
38590
  * must act on exactly these and nothing the filter hid.
38591
38591
  */
38592
- function useDataTableFilter(rows, config) {
38593
- const [state, setState] = useState(EMPTY_DATA_TABLE_FILTER);
38592
+ function useDataTableFilter(rows, config, initialState = EMPTY_DATA_TABLE_FILTER) {
38593
+ const [state, setState] = useState(initialState);
38594
38594
  const setSearch = useCallback((search) => {
38595
38595
  setState((prev) => ({
38596
38596
  ...prev,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/ui-library",
3
- "version": "1.2.279",
3
+ "version": "1.2.281",
4
4
  "type": "module",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",