@nar-bus/ui-kit 1.15.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  export interface ComboboxOption {
2
3
  value: string;
3
4
  label: string;
@@ -12,6 +13,16 @@ interface ComboboxPropsBase {
12
13
  onSearch?: (query: string) => void;
13
14
  className?: string;
14
15
  creatable?: boolean;
16
+ /**
17
+ * Static hint rendered inside the open panel, under the search box, whenever
18
+ * `creatable` is on — it stays visible before AND after typing, so the
19
+ * "a new value can be entered here" affordance does not depend on the user
20
+ * already having typed (the create row only appears once there is a query).
21
+ * Caller-supplied content (no package default literal — see the shared-copy
22
+ * rule); ignored when `creatable` is false. Closed-state affordance stays the
23
+ * caller's `placeholder`. (NB-COMBO-CREATE-HINT-01)
24
+ */
25
+ createHint?: ReactNode;
15
26
  }
16
27
  interface ComboboxPropsSingle extends ComboboxPropsBase {
17
28
  multiple?: false;
@@ -24,6 +35,6 @@ interface ComboboxPropsMultiple extends ComboboxPropsBase {
24
35
  onChange?: (value: string[]) => void;
25
36
  }
26
37
  export type ComboboxProps = ComboboxPropsSingle | ComboboxPropsMultiple;
27
- export declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, multiple, disabled, error, loading, onSearch, className, creatable, }: ComboboxProps): import("react").JSX.Element;
38
+ export declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, multiple, disabled, error, loading, onSearch, className, creatable, createHint, }: ComboboxProps): import("react").JSX.Element;
28
39
  export {};
29
40
  //# sourceMappingURL=Combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Combobox.d.ts","sourceRoot":"","sources":["../../src/molecules/Combobox.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,cAAc;IAAG,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;CAAE;AAEjE,UAAU,iBAAiB;IACzB,OAAO,EA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UAAU,iBAAiB;IACzB,OAAO,EAAE,cAAc,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC5E,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IACtD,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC;IAC5E;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AACD,UAAU,mBAAoB,SAAQ,iBAAiB;IAAG,QAAQ,CAAC,EAAE,KAAK,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAAE;AACjI,UAAU,qBAAsB,SAAQ,iBAAiB;IAAG,QAAQ,EAAE,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAAE;AACrI,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG,qBAAqB,CAAC;AA0NxE,wBAAgB,QAAQ,CAAC,EACvB,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAgB,EAAE,iBAAiB,EAAE,QAAgB,EAC/E,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,SAAiB,EAAE,UAAU,GAC7E,EAAE,aAAa,+BA0Jf"}
@@ -1,5 +1,5 @@
1
1
  import { SelectOption } from '../atoms/Select';
2
- export type FilterFieldType = "text" | "select" | "date" | "number" | "boolean" | "combobox";
2
+ export type FilterFieldType = "text" | "select" | "date" | "daterange" | "number" | "boolean" | "combobox";
3
3
  export interface FilterField {
4
4
  key: string;
5
5
  label: string;
@@ -28,6 +28,48 @@ export interface FilterField {
28
28
  * (via {@link FilterPanelProps.onDraftChange}) and re-pass `fields`.
29
29
  */
30
30
  dependsOn?: string;
31
+ /**
32
+ * For `type: "daterange"` — the `FilterValue.field` key carrying the range
33
+ * START bound. @default `` `${key}From` ``
34
+ *
35
+ * The emitted `FilterValue.field` values for a `daterange` field are ALWAYS its
36
+ * two bound keys (`fromKey` / `toKey`) — the field's own `key` drives only the
37
+ * label, the React key, the active chip and `dependsOn` targeting. That is what
38
+ * lets `FilterValue.value` stay a `string`: a range is two entries, not one
39
+ * `{from,to}` object, so no consumer has to narrow a union. Defaults follow the
40
+ * suffix pattern, so `{ key: "date", type: "daterange" }` emits `dateFrom` +
41
+ * `dateTo`; a consumer whose wire keys differ (e.g. `startDate`/`endDate`)
42
+ * passes `fromKey`/`toKey` explicitly.
43
+ *
44
+ * The operator is ALWAYS the documented one (`">="` for the start bound, `"<="`
45
+ * for the end bound) and a seeded operator on a bound key is deliberately
46
+ * IGNORED — see {@link FilterPanelProps.showOperators}, whose "a seeded operator
47
+ * survives even when the picker is hidden" rule this field type is the one
48
+ * documented exception to. A `daterange` has no operator picker and never will
49
+ * (the two bounds *are* its semantics), so there is no user intent to preserve.
50
+ *
51
+ * REQUIRED of the caller: `fromKey` and `toKey` must differ from each other, and
52
+ * neither may collide with another field's `key` or bound key. The panel keys its
53
+ * internal draft by these names, so a collision makes two controls share one
54
+ * slot — the same pre-existing constraint that already applies to two plain
55
+ * fields sharing a `key`. Setting this field's own `key` equal to one of its
56
+ * bound keys is harmless, but then that `key` does appear in the output.
57
+ */
58
+ fromKey?: string;
59
+ /**
60
+ * For `type: "daterange"` — the `FilterValue.field` key carrying the range
61
+ * END bound, always emitted with operator `"<="`. @default `` `${key}To` ``
62
+ * See {@link FilterField.fromKey} for the full contract (operator
63
+ * normalization + the key-uniqueness requirement).
64
+ */
65
+ toKey?: string;
66
+ /**
67
+ * For `type: "daterange"` — render the underlying `DateRangePicker`'s
68
+ * quick-range preset row (Today / Last 7 days / …). Off by default: the 280px
69
+ * filter rail is too narrow for the preset row to sit on one line.
70
+ * @default false
71
+ */
72
+ presets?: boolean;
31
73
  }
32
74
  export interface FilterValue {
33
75
  field: string;
@@ -1 +1 @@
1
- {"version":3,"file":"FilterPanel.d.ts","sourceRoot":"","sources":["../../src/organisms/FilterPanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAuB5D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE7F,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,eAAe,CAAC;IACtB;;0FAEsF;IACtF,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB;+EAC2E;IAC3E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AA8JD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,I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,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAiMD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,OAAO,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;;;;;;;OAWG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAC/C;;;oEAGgE;IAChE,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,MAAM,EAAE,cAAc,EACtB,OAAO,EACP,OAAO,EACP,OAAO,EACP,aAAa,EACb,aAAoB,GACrB,EAAE,gBAAgB,+BAuQlB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nar-bus/ui-kit",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",