@panneau/lists 5.0.0-alpha.0 → 5.0.0-alpha.2

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.
Files changed (54) hide show
  1. package/README.md +5 -1
  2. package/dist/ListView.css +16 -16
  3. package/dist/ListView.d.ts +7 -1
  4. package/dist/ListView.d.ts.map +1 -1
  5. package/dist/ListView.js +8 -5
  6. package/dist/ListView.js.map +1 -1
  7. package/dist/ListView.module.js +10 -10
  8. package/dist/actions/ActionButton.d.ts +4 -1
  9. package/dist/actions/ActionButton.d.ts.map +1 -1
  10. package/dist/actions/ActionButton.js +3 -3
  11. package/dist/actions/ActionButton.js.map +1 -1
  12. package/dist/actions/Actions.css +9 -9
  13. package/dist/actions/Actions.module.js +6 -6
  14. package/dist/actions/RowActions.d.ts +4 -1
  15. package/dist/actions/RowActions.d.ts.map +1 -1
  16. package/dist/actions/RowActions.js +37 -33
  17. package/dist/actions/RowActions.js.map +1 -1
  18. package/dist/actions/icons.d.ts +8 -3
  19. package/dist/actions/icons.d.ts.map +1 -1
  20. package/dist/actions/icons.js +11 -7
  21. package/dist/actions/icons.js.map +1 -1
  22. package/dist/displays/Displays.css +13 -13
  23. package/dist/displays/Displays.module.js +12 -12
  24. package/dist/displays/Displays.module.js.map +1 -1
  25. package/dist/filters/Filters.css +13 -13
  26. package/dist/filters/Filters.module.js +8 -8
  27. package/dist/filters/controls.d.ts +2 -2
  28. package/dist/filters/controls.d.ts.map +1 -1
  29. package/dist/filters/controls.js +145 -119
  30. package/dist/filters/controls.js.map +1 -1
  31. package/dist/filters/format.d.ts.map +1 -1
  32. package/dist/filters/format.js +4 -1
  33. package/dist/filters/format.js.map +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -1
  37. package/dist/layouts/CardsLayout.css +17 -11
  38. package/dist/layouts/CardsLayout.module.js +8 -8
  39. package/dist/layouts/CardsLayout.module.js.map +1 -1
  40. package/dist/layouts/ItemTitle.d.ts +1 -1
  41. package/dist/layouts/TableLayout.css +35 -35
  42. package/dist/layouts/TableLayout.module.js +12 -12
  43. package/dist/layouts/TableLayout.module.js.map +1 -1
  44. package/dist/layouts/link.css +3 -3
  45. package/dist/layouts/link.module.js +1 -1
  46. package/dist/query.d.ts +2 -2
  47. package/dist/query.d.ts.map +1 -1
  48. package/dist/query.js +7 -2
  49. package/dist/query.js.map +1 -1
  50. package/dist/toolbar/Toolbar.css +12 -12
  51. package/dist/toolbar/Toolbar.module.js +7 -7
  52. package/dist/types.d.ts +2 -1
  53. package/dist/types.d.ts.map +1 -1
  54. package/package.json +7 -7
@@ -10,15 +10,16 @@ import { Ellipsis } from "lucide-react";
10
10
  //#region src/actions/RowActions.tsx
11
11
  /** The actions of a row: buttons, then an overflow menu. */
12
12
  function RowActions(t0) {
13
- const $ = c(23);
14
- const { item, itemLabel, actions, menu, pending, onRun } = t0;
13
+ const $ = c(26);
14
+ const { item, itemLabel, actions, menu, pending, onRun, icons } = t0;
15
15
  const intl = usePanneauIntl();
16
16
  let t1;
17
- if ($[0] !== actions || $[1] !== intl || $[2] !== item || $[3] !== itemLabel || $[4] !== onRun || $[5] !== pending) {
17
+ if ($[0] !== actions || $[1] !== icons || $[2] !== intl || $[3] !== item || $[4] !== itemLabel || $[5] !== onRun || $[6] !== pending) {
18
18
  let t2;
19
- if ($[7] !== intl || $[8] !== item || $[9] !== itemLabel || $[10] !== onRun || $[11] !== pending) {
19
+ if ($[8] !== icons || $[9] !== intl || $[10] !== item || $[11] !== itemLabel || $[12] !== onRun || $[13] !== pending) {
20
20
  t2 = (action) => /* @__PURE__ */ jsx(ActionButton, {
21
21
  action,
22
+ icons,
22
23
  href: getActionHref(action, item),
23
24
  isPending: pending === action.id,
24
25
  isDisabled: pending !== null && pending !== action.id,
@@ -28,24 +29,26 @@ function RowActions(t0) {
28
29
  }),
29
30
  onPress: () => onRun(action)
30
31
  }, action.id);
31
- $[7] = intl;
32
- $[8] = item;
33
- $[9] = itemLabel;
34
- $[10] = onRun;
35
- $[11] = pending;
36
- $[12] = t2;
37
- } else t2 = $[12];
32
+ $[8] = icons;
33
+ $[9] = intl;
34
+ $[10] = item;
35
+ $[11] = itemLabel;
36
+ $[12] = onRun;
37
+ $[13] = pending;
38
+ $[14] = t2;
39
+ } else t2 = $[14];
38
40
  t1 = actions.map(t2);
39
41
  $[0] = actions;
40
- $[1] = intl;
41
- $[2] = item;
42
- $[3] = itemLabel;
43
- $[4] = onRun;
44
- $[5] = pending;
45
- $[6] = t1;
46
- } else t1 = $[6];
42
+ $[1] = icons;
43
+ $[2] = intl;
44
+ $[3] = item;
45
+ $[4] = itemLabel;
46
+ $[5] = onRun;
47
+ $[6] = pending;
48
+ $[7] = t1;
49
+ } else t1 = $[7];
47
50
  let t2;
48
- if ($[13] !== intl || $[14] !== item || $[15] !== itemLabel || $[16] !== menu || $[17] !== onRun || $[18] !== pending) {
51
+ if ($[15] !== icons || $[16] !== intl || $[17] !== item || $[18] !== itemLabel || $[19] !== menu || $[20] !== onRun || $[21] !== pending) {
49
52
  t2 = menu.length > 0 ? /* @__PURE__ */ jsxs(MenuTrigger, { children: [/* @__PURE__ */ jsx(IconButton, {
50
53
  icon: Ellipsis,
51
54
  size: "sm",
@@ -59,7 +62,7 @@ function RowActions(t0) {
59
62
  },
60
63
  children: menu.map((action_2) => {
61
64
  const href = getActionHref(action_2, item);
62
- const icon = getActionIcon(action_2);
65
+ const icon = getActionIcon(action_2, icons);
63
66
  return /* @__PURE__ */ jsx(MenuItem, {
64
67
  id: action_2.id,
65
68
  isDanger: action_2.destructive === true,
@@ -69,24 +72,25 @@ function RowActions(t0) {
69
72
  }, action_2.id);
70
73
  })
71
74
  })] }) : null;
72
- $[13] = intl;
73
- $[14] = item;
74
- $[15] = itemLabel;
75
- $[16] = menu;
76
- $[17] = onRun;
77
- $[18] = pending;
78
- $[19] = t2;
79
- } else t2 = $[19];
75
+ $[15] = icons;
76
+ $[16] = intl;
77
+ $[17] = item;
78
+ $[18] = itemLabel;
79
+ $[19] = menu;
80
+ $[20] = onRun;
81
+ $[21] = pending;
82
+ $[22] = t2;
83
+ } else t2 = $[22];
80
84
  let t3;
81
- if ($[20] !== t1 || $[21] !== t2) {
85
+ if ($[23] !== t1 || $[24] !== t2) {
82
86
  t3 = /* @__PURE__ */ jsxs("div", {
83
87
  className: Actions_module_default.row,
84
88
  children: [t1, t2]
85
89
  });
86
- $[20] = t1;
87
- $[21] = t2;
88
- $[22] = t3;
89
- } else t3 = $[22];
90
+ $[23] = t1;
91
+ $[24] = t2;
92
+ $[25] = t3;
93
+ } else t3 = $[25];
90
94
  return t3;
91
95
  }
92
96
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"RowActions.js","names":["action","Ellipsis","_c","styles"],"sources":["../../src/actions/RowActions.tsx"],"sourcesContent":["import { Ellipsis } from 'lucide-react';\n\nimport type { Action } from '@panneau/protocol';\nimport { IconButton, Menu, MenuItem, MenuTrigger, usePanneauIntl } from '@panneau/ui';\n\nimport { messages } from '../messages';\nimport type { ListItem } from '../types';\nimport { ActionButton } from './ActionButton';\nimport styles from './Actions.module.css';\nimport { getActionHref } from './actions';\nimport { getActionIcon } from './icons';\n\nexport interface RowActionsProps {\n item: ListItem;\n /** The label of the item, for the accessible names of its actions. */\n itemLabel: string;\n /** Actions shown as buttons. */\n actions: readonly Action[];\n /** Actions in the overflow menu. */\n menu: readonly Action[];\n /** Id of the action that is running on this item, if any. */\n pending: string | null;\n onRun: (action: Action) => void;\n}\n\n/** The actions of a row: buttons, then an overflow menu. */\nexport function RowActions({ item, itemLabel, actions, menu, pending, onRun }: RowActionsProps) {\n const intl = usePanneauIntl();\n return (\n <div className={styles.row}>\n {actions.map((action) => (\n <ActionButton\n key={action.id}\n action={action}\n href={getActionHref(action, item)}\n isPending={pending === action.id}\n isDisabled={pending !== null && pending !== action.id}\n aria-label={intl.formatMessage(messages.actionOnItem, {\n action: action.label,\n item: itemLabel,\n })}\n onPress={() => onRun(action)}\n />\n ))}\n {menu.length > 0 ? (\n <MenuTrigger>\n <IconButton\n icon={Ellipsis}\n size=\"sm\"\n label={intl.formatMessage(messages.itemActions, { item: itemLabel })}\n isPending={pending !== null && menu.some((action) => action.id === pending)}\n />\n <Menu\n placement=\"bottom end\"\n onAction={(key) => {\n const action = menu.find((candidate) => candidate.id === key);\n if (action !== undefined && getActionHref(action, item) === null) {\n onRun(action);\n }\n }}\n >\n {menu.map((action) => {\n const href = getActionHref(action, item);\n const icon = getActionIcon(action);\n return (\n <MenuItem\n key={action.id}\n id={action.id}\n isDanger={action.destructive === true}\n {...(icon !== undefined ? { icon } : {})}\n {...(href !== null ? { href } : {})}\n >\n {action.label}\n </MenuItem>\n );\n })}\n </Menu>\n </MenuTrigger>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA0BA,SAAO,WAAA,IAAA;CAAA,MAAA,IAAAE,EAAA,EAAA;CAAoB,MAAA,EAAA,MAAA,WAAA,SAAA,MAAA,SAAA,UAAA;CACvB,MAAA,OAAa,eAAe;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA,EAAA,OAAA,QAAA,EAAA,OAAA,QAAA,EAAA,OAAA,aAAA,EAAA,OAAA,SAAA,EAAA,OAAA,SAAA;EAAA,IAAA;EAAA,IAAA,EAAA,OAAA,QAAA,EAAA,OAAA,QAAA,EAAA,OAAA,aAAA,EAAA,QAAA,SAAA,EAAA,QAAA,SAAA;GAGT,MAAA,WACT,oBAAC,cAAD;IAEY;IACF,MAAA,cAAc,QAAQ,IAAI;IACrB,WAAA,YAAY,OAAM;IACjB,YAAA,YAAY,QAAQ,YAAY,OAAM;IACtC,cAAA,KAAI,cAAe,SAAQ,cAAe;KAAA,QAC1C,OAAM;KAAM,MACd;IACV,CAAC;IACQ,eAAM,MAAM,MAAM;GAAC,GATvB,OAAM,EASiB;GAEnC,EAAA,KAAA;GAAA,EAAA,KAAA;GAAA,EAAA,KAAA;GAAA,EAAA,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,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;EAjDZ,KAAA,qBAAA,OAAA;GAAgB,WAAAG,uBAAM;GAAtB,UAAA,CACK,IAcA,EAmCC;;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAlDN;AAkDM"}
1
+ {"version":3,"file":"RowActions.js","names":["action","icons","Ellipsis","_c","styles"],"sources":["../../src/actions/RowActions.tsx"],"sourcesContent":["import { Ellipsis } from 'lucide-react';\n\nimport type { Action } from '@panneau/protocol';\nimport { IconButton, Menu, MenuItem, MenuTrigger, usePanneauIntl } from '@panneau/ui';\n\nimport { messages } from '../messages';\nimport type { ListItem } from '../types';\nimport { ActionButton } from './ActionButton';\nimport styles from './Actions.module.css';\nimport { getActionHref } from './actions';\nimport { type ActionIcons, getActionIcon } from './icons';\n\nexport interface RowActionsProps {\n item: ListItem;\n /** The label of the item, for the accessible names of its actions. */\n itemLabel: string;\n /** Actions shown as buttons. */\n actions: readonly Action[];\n /** Actions in the overflow menu. */\n menu: readonly Action[];\n /** Id of the action that is running on this item, if any. */\n pending: string | null;\n onRun: (action: Action) => void;\n /** Icons of actions by id, over the icon the action names. */\n icons?: ActionIcons | undefined;\n}\n\n/** The actions of a row: buttons, then an overflow menu. */\nexport function RowActions({\n item,\n itemLabel,\n actions,\n menu,\n pending,\n onRun,\n icons,\n}: RowActionsProps) {\n const intl = usePanneauIntl();\n return (\n <div className={styles.row}>\n {actions.map((action) => (\n <ActionButton\n key={action.id}\n action={action}\n icons={icons}\n href={getActionHref(action, item)}\n isPending={pending === action.id}\n isDisabled={pending !== null && pending !== action.id}\n aria-label={intl.formatMessage(messages.actionOnItem, {\n action: action.label,\n item: itemLabel,\n })}\n onPress={() => onRun(action)}\n />\n ))}\n {menu.length > 0 ? (\n <MenuTrigger>\n <IconButton\n icon={Ellipsis}\n size=\"sm\"\n label={intl.formatMessage(messages.itemActions, { item: itemLabel })}\n isPending={pending !== null && menu.some((action) => action.id === pending)}\n />\n <Menu\n placement=\"bottom end\"\n onAction={(key) => {\n const action = menu.find((candidate) => candidate.id === key);\n if (action !== undefined && getActionHref(action, item) === null) {\n onRun(action);\n }\n }}\n >\n {menu.map((action) => {\n const href = getActionHref(action, item);\n const icon = getActionIcon(action, icons);\n return (\n <MenuItem\n key={action.id}\n id={action.id}\n isDanger={action.destructive === true}\n {...(icon !== undefined ? { icon } : {})}\n {...(href !== null ? { href } : {})}\n >\n {action.label}\n </MenuItem>\n );\n })}\n </Menu>\n </MenuTrigger>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA4BA,SAAO,WAAA,IAAA;CAAA,MAAA,IAAAG,EAAA,EAAA;CAAoB,MAAA,EAAA,MAAA,WAAA,SAAA,MAAA,SAAA,OAAA,UAAA;CASvB,MAAA,OAAa,eAAe;CAAE,IAAA;CAAA,IAAA,EAAA,OAAA,WAAA,EAAA,OAAA,SAAA,EAAA,OAAA,QAAA,EAAA,OAAA,QAAA,EAAA,OAAA,aAAA,EAAA,OAAA,SAAA,EAAA,OAAA,SAAA;EAAA,IAAA;EAAA,IAAA,EAAA,OAAA,SAAA,EAAA,OAAA,QAAA,EAAA,QAAA,QAAA,EAAA,QAAA,aAAA,EAAA,QAAA,SAAA,EAAA,QAAA,SAAA;GAGT,MAAA,WACT,oBAAC,cAAD;IAEY;IACD;IACD,MAAA,cAAc,QAAQ,IAAI;IACrB,WAAA,YAAY,OAAM;IACjB,YAAA,YAAY,QAAQ,YAAY,OAAM;IACtC,cAAA,KAAI,cAAe,SAAQ,cAAe;KAAA,QAC1C,OAAM;KAAM,MACd;IACV,CAAC;IACQ,eAAM,MAAM,MAAM;GAAC,GAVvB,OAAM,EAUiB;GAEnC,EAAA,KAAA;GAAA,EAAA,KAA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vBA,CAAA,CAPG,EAAA,CAAA,IADf;EAkCO,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,IAAA;CAAA,IAAA,EAAA,QAAA,MAAA,EAAA,QAAA,IAAA;EAlDZ,KAAA,qBAAA,OAAA;GAAgB,WAAAI,uBAAM;GAAtB,UAAA,CACK,IAeA,EAmCC;;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;EAAA,EAAA,MAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAnDN;AAmDM"}
@@ -1,5 +1,10 @@
1
- import { type LucideIcon } from 'lucide-react';
2
1
  import type { Action } from '@panneau/protocol';
3
- /** The icon of an action, for the built-in ones. */
4
- export declare function getActionIcon(action: Action): LucideIcon | undefined;
2
+ import { type IconComponent } from '@panneau/ui';
3
+ /** Icons of actions by action id, for actions written in code (`{ archive: Archive }`). */
4
+ export type ActionIcons = Readonly<Record<string, IconComponent>>;
5
+ /**
6
+ * The icon of an action: the one given for its id in `icons`, then the Lucide icon its `icon`
7
+ * names (`"send"`, loaded when it first renders), then the icon of a built-in action.
8
+ */
9
+ export declare function getActionIcon(action: Action, icons?: ActionIcons): IconComponent | undefined;
5
10
  //# sourceMappingURL=icons.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/actions/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,UAAU,EAKlB,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAgBhD,oDAAoD;AACpD,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAEpE"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/actions/icons.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,KAAK,aAAa,EAAgB,MAAM,aAAa,CAAC;AAE/D,2FAA2F;AAC3F,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;AAalE;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,aAAa,GAAG,SAAS,CAU5F"}
@@ -1,9 +1,7 @@
1
+ import { getNamedIcon } from "@panneau/ui";
1
2
  import { Copy, Download, Eye, Pencil, RotateCcw, Trash2, Upload } from "lucide-react";
2
3
  //#region src/actions/icons.ts
3
- /**
4
- * Icons of the built-in actions. Icons named in definitions (`"icon": "send"`) need a lookup by
5
- * name, which comes with the actions of Phase 2 (decision 0020).
6
- */
4
+ /** Icons of the built-in actions, when they don't name one. */
7
5
  var BUILT_IN_ICONS = {
8
6
  show: Eye,
9
7
  edit: Pencil,
@@ -13,9 +11,15 @@ var BUILT_IN_ICONS = {
13
11
  export: Download,
14
12
  import: Upload
15
13
  };
16
- /** The icon of an action, for the built-in ones. */
17
- function getActionIcon(action) {
18
- return BUILT_IN_ICONS[action.id];
14
+ /**
15
+ * The icon of an action: the one given for its id in `icons`, then the Lucide icon its `icon`
16
+ * names (`"send"`, loaded when it first renders), then the icon of a built-in action.
17
+ */
18
+ function getActionIcon(action, icons) {
19
+ const given = icons !== void 0 && Object.hasOwn(icons, action.id) ? icons[action.id] : void 0;
20
+ if (given !== void 0) return given;
21
+ if (action.icon !== void 0 && action.icon !== "") return getNamedIcon(action.icon);
22
+ return Object.hasOwn(BUILT_IN_ICONS, action.id) ? BUILT_IN_ICONS[action.id] : void 0;
19
23
  }
20
24
  //#endregion
21
25
  export { getActionIcon };
@@ -1 +1 @@
1
- {"version":3,"file":"icons.js","names":[],"sources":["../../src/actions/icons.ts"],"sourcesContent":["import {\n Copy,\n Download,\n Eye,\n type LucideIcon,\n Pencil,\n RotateCcw,\n Trash2,\n Upload,\n} from 'lucide-react';\n\nimport type { Action } from '@panneau/protocol';\n\n/**\n * Icons of the built-in actions. Icons named in definitions (`\"icon\": \"send\"`) need a lookup by\n * name, which comes with the actions of Phase 2 (decision 0020).\n */\nconst BUILT_IN_ICONS: Record<string, LucideIcon> = {\n show: Eye,\n edit: Pencil,\n duplicate: Copy,\n delete: Trash2,\n restore: RotateCcw,\n export: Download,\n import: Upload,\n};\n\n/** The icon of an action, for the built-in ones. */\nexport function getActionIcon(action: Action): LucideIcon | undefined {\n return BUILT_IN_ICONS[action.id];\n}\n"],"mappings":";;;;;;AAiBA,IAAM,iBAA6C;CAC/C,MAAM;CACN,MAAM;CACN,WAAW;CACX,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;AACZ;;AAGA,SAAgB,cAAc,QAAwC;CAClE,OAAO,eAAe,OAAO;AACjC"}
1
+ {"version":3,"file":"icons.js","names":[],"sources":["../../src/actions/icons.ts"],"sourcesContent":["import {\n Copy,\n Download,\n Eye,\n type LucideIcon,\n Pencil,\n RotateCcw,\n Trash2,\n Upload,\n} from 'lucide-react';\n\nimport type { Action } from '@panneau/protocol';\nimport { type IconComponent, getNamedIcon } from '@panneau/ui';\n\n/** Icons of actions by action id, for actions written in code (`{ archive: Archive }`). */\nexport type ActionIcons = Readonly<Record<string, IconComponent>>;\n\n/** Icons of the built-in actions, when they don't name one. */\nconst BUILT_IN_ICONS: Record<string, LucideIcon> = {\n show: Eye,\n edit: Pencil,\n duplicate: Copy,\n delete: Trash2,\n restore: RotateCcw,\n export: Download,\n import: Upload,\n};\n\n/**\n * The icon of an action: the one given for its id in `icons`, then the Lucide icon its `icon`\n * names (`\"send\"`, loaded when it first renders), then the icon of a built-in action.\n */\nexport function getActionIcon(action: Action, icons?: ActionIcons): IconComponent | undefined {\n const given =\n icons !== undefined && Object.hasOwn(icons, action.id) ? icons[action.id] : undefined;\n if (given !== undefined) {\n return given;\n }\n if (action.icon !== undefined && action.icon !== '') {\n return getNamedIcon(action.icon);\n }\n return Object.hasOwn(BUILT_IN_ICONS, action.id) ? BUILT_IN_ICONS[action.id] : undefined;\n}\n"],"mappings":";;;;AAkBA,IAAM,iBAA6C;CAC/C,MAAM;CACN,MAAM;CACN,WAAW;CACX,QAAQ;CACR,SAAS;CACT,QAAQ;CACR,QAAQ;AACZ;;;;;AAMA,SAAgB,cAAc,QAAgB,OAAgD;CAC1F,MAAM,QACF,UAAU,KAAA,KAAa,OAAO,OAAO,OAAO,OAAO,EAAE,IAAI,MAAM,OAAO,MAAM,KAAA;CAChF,IAAI,UAAU,KAAA,GACV,OAAO;CAEX,IAAI,OAAO,SAAS,KAAA,KAAa,OAAO,SAAS,IAC7C,OAAO,aAAa,OAAO,IAAI;CAEnC,OAAO,OAAO,OAAO,gBAAgB,OAAO,EAAE,IAAI,eAAe,OAAO,MAAM,KAAA;AAClF"}
@@ -1,8 +1,8 @@
1
- .panneau-empty-xEtZBq {
1
+ .panneau-displays-empty {
2
2
  color: var(--panneau-color-text-muted);
3
3
  }
4
4
 
5
- .panneau-text-vty-EA {
5
+ .panneau-displays-text {
6
6
  display: -webkit-box;
7
7
  overflow: hidden;
8
8
  -webkit-line-clamp: 2;
@@ -11,35 +11,35 @@
11
11
  overflow-wrap: anywhere;
12
12
  }
13
13
 
14
- .panneau-badges-2n5UJa {
14
+ .panneau-displays-badges {
15
15
  display: inline-flex;
16
16
  flex-wrap: wrap;
17
17
  gap: var(--panneau-space-1);
18
18
  }
19
19
 
20
- .panneau-boolean-vvV7kf {
20
+ .panneau-displays-boolean {
21
21
  display: inline-flex;
22
22
  align-items: center;
23
23
  }
24
24
 
25
- .panneau-true-Iu6Hsd {
25
+ .panneau-displays-true {
26
26
  color: var(--panneau-color-success);
27
27
  }
28
28
 
29
- .panneau-false-zp5WgH {
29
+ .panneau-displays-false {
30
30
  color: var(--panneau-color-text-muted);
31
31
  }
32
32
 
33
- .panneau-number-yfICs7 {
34
- font-variant-numeric: tabular-nums;
33
+ .panneau-displays-number {
34
+ font-variant-numeric: var(--panneau-font-numeric);
35
35
  }
36
36
 
37
- .panneau-link-nvMTOa {
37
+ .panneau-displays-link {
38
38
  color: var(--panneau-color-link);
39
39
  overflow-wrap: anywhere;
40
40
  }
41
41
 
42
- .panneau-color-kkWQ1L {
42
+ .panneau-displays-color {
43
43
  display: inline-flex;
44
44
  align-items: center;
45
45
  gap: var(--panneau-space-2);
@@ -47,7 +47,7 @@
47
47
  font-size: var(--panneau-font-size-sm);
48
48
  }
49
49
 
50
- .panneau-swatch-50Qwvv {
50
+ .panneau-displays-swatch {
51
51
  flex: none;
52
52
  width: 1rem;
53
53
  height: 1rem;
@@ -55,13 +55,13 @@
55
55
  border-radius: var(--panneau-radius-sm);
56
56
  }
57
57
 
58
- .panneau-media-EOUwYg {
58
+ .panneau-displays-media {
59
59
  display: inline-flex;
60
60
  align-items: center;
61
61
  gap: var(--panneau-space-2);
62
62
  }
63
63
 
64
- .panneau-thumbnail-WgBzFY {
64
+ .panneau-displays-thumbnail {
65
65
  flex: none;
66
66
  width: 2.5rem;
67
67
  height: 2.5rem;
@@ -1,22 +1,22 @@
1
1
  import "./Displays.css";
2
2
  //#region src/displays/Displays.module.css
3
- var empty = "panneau-empty-xEtZBq";
4
- var text = "panneau-text-vty-EA";
5
- var badges = "panneau-badges-2n5UJa";
6
- var boolean = "panneau-boolean-vvV7kf";
7
- var number = "panneau-number-yfICs7";
8
- var link = "panneau-link-nvMTOa";
9
- var color = "panneau-color-kkWQ1L";
10
- var swatch = "panneau-swatch-50Qwvv";
11
- var media = "panneau-media-EOUwYg";
12
- var thumbnail = "panneau-thumbnail-WgBzFY";
3
+ var empty = "panneau-displays-empty";
4
+ var text = "panneau-displays-text";
5
+ var badges = "panneau-displays-badges";
6
+ var boolean = "panneau-displays-boolean";
7
+ var number = "panneau-displays-number";
8
+ var link = "panneau-displays-link";
9
+ var color = "panneau-displays-color";
10
+ var swatch = "panneau-displays-swatch";
11
+ var media = "panneau-displays-media";
12
+ var thumbnail = "panneau-displays-thumbnail";
13
13
  var Displays_module_default = {
14
14
  empty,
15
15
  text,
16
16
  badges,
17
17
  boolean,
18
- "true": "panneau-true-Iu6Hsd",
19
- "false": "panneau-false-zp5WgH",
18
+ "true": "panneau-displays-true",
19
+ "false": "panneau-displays-false",
20
20
  number,
21
21
  link,
22
22
  color,
@@ -1 +1 @@
1
- {"version":3,"file":"Displays.module.js","names":[],"sources":["../../src/displays/Displays.module.css"],"sourcesContent":[".empty {\n color: var(--panneau-color-text-muted);\n}\n\n.text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow-wrap: anywhere;\n}\n\n.badges {\n display: inline-flex;\n flex-wrap: wrap;\n gap: var(--panneau-space-1);\n}\n\n.boolean {\n display: inline-flex;\n align-items: center;\n}\n\n.true {\n color: var(--panneau-color-success);\n}\n\n.false {\n color: var(--panneau-color-text-muted);\n}\n\n.number {\n font-variant-numeric: tabular-nums;\n}\n\n.link {\n color: var(--panneau-color-link);\n overflow-wrap: anywhere;\n}\n\n.color {\n display: inline-flex;\n align-items: center;\n gap: var(--panneau-space-2);\n font-family: var(--panneau-font-family-mono);\n font-size: var(--panneau-font-size-sm);\n}\n\n.swatch {\n flex: none;\n width: 1rem;\n height: 1rem;\n border: var(--panneau-border-width) solid var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-sm);\n}\n\n.media {\n display: inline-flex;\n align-items: center;\n gap: var(--panneau-space-2);\n}\n\n.thumbnail {\n flex: none;\n width: 2.5rem;\n height: 2.5rem;\n object-fit: cover;\n background-color: var(--panneau-color-surface-sunken);\n border-radius: var(--panneau-radius-sm);\n}\n"],"mappings":""}
1
+ {"version":3,"file":"Displays.module.js","names":[],"sources":["../../src/displays/Displays.module.css"],"sourcesContent":[".empty {\n color: var(--panneau-color-text-muted);\n}\n\n.text {\n display: -webkit-box;\n overflow: hidden;\n -webkit-line-clamp: 2;\n line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow-wrap: anywhere;\n}\n\n.badges {\n display: inline-flex;\n flex-wrap: wrap;\n gap: var(--panneau-space-1);\n}\n\n.boolean {\n display: inline-flex;\n align-items: center;\n}\n\n.true {\n color: var(--panneau-color-success);\n}\n\n.false {\n color: var(--panneau-color-text-muted);\n}\n\n.number {\n font-variant-numeric: var(--panneau-font-numeric);\n}\n\n.link {\n color: var(--panneau-color-link);\n overflow-wrap: anywhere;\n}\n\n.color {\n display: inline-flex;\n align-items: center;\n gap: var(--panneau-space-2);\n font-family: var(--panneau-font-family-mono);\n font-size: var(--panneau-font-size-sm);\n}\n\n.swatch {\n flex: none;\n width: 1rem;\n height: 1rem;\n border: var(--panneau-border-width) solid var(--panneau-color-border-control);\n border-radius: var(--panneau-radius-sm);\n}\n\n.media {\n display: inline-flex;\n align-items: center;\n gap: var(--panneau-space-2);\n}\n\n.thumbnail {\n flex: none;\n width: 2.5rem;\n height: 2.5rem;\n object-fit: cover;\n background-color: var(--panneau-color-surface-sunken);\n border-radius: var(--panneau-radius-sm);\n}\n"],"mappings":""}
@@ -1,35 +1,35 @@
1
- .panneau-filters-9H41r8 {
1
+ .panneau-filters {
2
2
  display: flex;
3
3
  flex-wrap: wrap;
4
4
  align-items: flex-end;
5
5
  gap: var(--panneau-space-3);
6
6
  }
7
7
 
8
- .panneau-control-vD-jl2 {
8
+ .panneau-filters-control {
9
9
  width: 12rem;
10
10
  max-width: 100%;
11
11
  }
12
12
 
13
- .panneau-toggle-aBWzSX {
13
+ .panneau-filters-toggle {
14
14
  align-self: center;
15
15
  min-height: var(--panneau-control-height);
16
16
  display: flex;
17
17
  align-items: center;
18
18
  }
19
19
 
20
- .panneau-range-lY9OdJ {
20
+ .panneau-filters-range {
21
21
  display: flex;
22
22
  flex-wrap: wrap;
23
23
  gap: var(--panneau-space-2);
24
24
  max-width: 100%;
25
25
  }
26
26
 
27
- .panneau-range-lY9OdJ > :not(legend) {
27
+ .panneau-filters-range > :not(legend) {
28
28
  width: 11rem;
29
29
  max-width: 100%;
30
30
  }
31
31
 
32
- .panneau-chips-zPj5hD {
32
+ .panneau-filters-chips {
33
33
  display: flex;
34
34
  flex-wrap: wrap;
35
35
  align-items: center;
@@ -39,7 +39,7 @@
39
39
  list-style: none;
40
40
  }
41
41
 
42
- .panneau-chip-RQRPo6 {
42
+ .panneau-filters-chip {
43
43
  display: inline-flex;
44
44
  align-items: center;
45
45
  gap: var(--panneau-space-1);
@@ -51,21 +51,21 @@
51
51
  border-radius: var(--panneau-radius-full);
52
52
  }
53
53
 
54
- .panneau-chipText-Uofas9 {
54
+ .panneau-filters-chip-text {
55
55
  overflow: hidden;
56
56
  text-overflow: ellipsis;
57
57
  white-space: nowrap;
58
58
  }
59
59
 
60
- .panneau-chipLabel-QsALcI {
60
+ .panneau-filters-chip-label {
61
61
  color: var(--panneau-color-text-muted);
62
62
  }
63
63
 
64
64
  @container panneau-list (max-width: 40rem) {
65
- .panneau-filters-9H41r8,
66
- .panneau-control-vD-jl2,
67
- .panneau-range-lY9OdJ,
68
- .panneau-range-lY9OdJ > :not(legend) {
65
+ .panneau-filters,
66
+ .panneau-filters-control,
67
+ .panneau-filters-range,
68
+ .panneau-filters-range > :not(legend) {
69
69
  width: 100%;
70
70
  }
71
71
  }
@@ -1,13 +1,13 @@
1
1
  import "./Filters.css";
2
2
  //#region src/filters/Filters.module.css
3
- var filters = "panneau-filters-9H41r8";
4
- var control = "panneau-control-vD-jl2";
5
- var toggle = "panneau-toggle-aBWzSX";
6
- var range = "panneau-range-lY9OdJ";
7
- var chips = "panneau-chips-zPj5hD";
8
- var chip = "panneau-chip-RQRPo6";
9
- var chipText = "panneau-chipText-Uofas9";
10
- var chipLabel = "panneau-chipLabel-QsALcI";
3
+ var filters = "panneau-filters";
4
+ var control = "panneau-filters-control";
5
+ var toggle = "panneau-filters-toggle";
6
+ var range = "panneau-filters-range";
7
+ var chips = "panneau-filters-chips";
8
+ var chip = "panneau-filters-chip";
9
+ var chipText = "panneau-filters-chip-text";
10
+ var chipLabel = "panneau-filters-chip-label";
11
11
  var Filters_module_default = {
12
12
  filters,
13
13
  control,
@@ -8,8 +8,8 @@ export declare function ToggleFilter({ label, value, onChange }: FilterControlPr
8
8
  /** A day (`2026-10-15`). */
9
9
  export declare function DateFilter({ label, value, onChange }: FilterControlProps): import("react").JSX.Element;
10
10
  /**
11
- * A range of days, sent as `[from, to]` (`filter[published_at][]=2026-01-01&…`). An open end is an
12
- * empty string.
11
+ * A range of days, sent as its bounds (`filter[published_at][from]=2026-01-01&…[to]=…`). Either end
12
+ * can be open: it is left out.
13
13
  */
14
14
  export declare function DateRangeFilter({ label, value, onChange }: FilterControlProps): import("react").JSX.Element;
15
15
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../../src/filters/controls.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAWhE,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAmBxE;AAED,8DAA8D;AAC9D,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAgC3F;AAED,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAU1E;AAED,4BAA4B;AAC5B,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BASxE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,kBAAkB,+BAmB7E;AAED;;;;G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