@wallarm-org/design-system 0.27.0 → 1.0.0-rc-feature-AS-877-fix-filter-code.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 (26) hide show
  1. package/dist/components/FilterInput/FilterInput.js +5 -1
  2. package/dist/components/FilterInput/index.d.ts +2 -2
  3. package/dist/components/FilterInput/lib/applyFieldPresets.d.ts +8 -0
  4. package/dist/components/FilterInput/lib/applyFieldPresets.js +27 -0
  5. package/dist/components/FilterInput/lib/index.d.ts +2 -1
  6. package/dist/components/FilterInput/lib/index.js +2 -1
  7. package/dist/components/FilterInput/lib/statusCode/createStatusCodeSuggestions.d.ts +5 -4
  8. package/dist/components/FilterInput/lib/statusCode/createStatusCodeSuggestions.js +5 -6
  9. package/dist/components/FilterInput/lib/statusCode/createStatusCodeValidator.d.ts +1 -8
  10. package/dist/components/FilterInput/lib/statusCode/createStatusCodeValidator.js +3 -3
  11. package/dist/components/FilterInput/lib/statusCode/index.d.ts +0 -1
  12. package/dist/components/FilterInput/lib/statusCode/utils/canonicalize.d.ts +2 -2
  13. package/dist/components/FilterInput/lib/statusCode/utils/canonicalize.js +3 -3
  14. package/dist/components/FilterInput/lib/statusCode/utils/constants.d.ts +7 -3
  15. package/dist/components/FilterInput/lib/statusCode/utils/constants.js +3 -3
  16. package/dist/components/FilterInput/lib/statusCode/utils/index.d.ts +1 -3
  17. package/dist/components/FilterInput/lib/statusCode/utils/index.js +2 -3
  18. package/dist/components/FilterInput/types.d.ts +13 -0
  19. package/dist/metadata/components.json +3 -4
  20. package/package.json +1 -1
  21. package/dist/components/FilterInput/lib/statusCode/utils/maskRoots.d.ts +0 -4
  22. package/dist/components/FilterInput/lib/statusCode/utils/maskRoots.js +0 -3
  23. package/dist/components/FilterInput/lib/statusCode/utils/types.d.ts +0 -8
  24. package/dist/components/FilterInput/lib/statusCode/utils/types.js +0 -0
  25. package/dist/components/FilterInput/stories/mockStatusCodes.d.ts +0 -6
  26. package/dist/components/FilterInput/stories/mockStatusCodes.js +0 -20
@@ -6,7 +6,8 @@ import { FilterInputErrors, parseFilterInputErrors } from "./FilterInputErrors/i
6
6
  import { FilterInputField } from "./FilterInputField/index.js";
7
7
  import { FilterInputMenu } from "./FilterInputMenu/FilterInputMenu.js";
8
8
  import { useFilterInputAutocomplete, useFilterInputExpression, useFilterInputSelection } from "./hooks/index.js";
9
- const FilterInput = ({ fields = [], value, onChange, placeholder = 'Type to filter...', error = false, showKeyboardHint = false, className, ...props })=>{
9
+ import { applyFieldPresets } from "./lib/applyFieldPresets.js";
10
+ const FilterInput = ({ fields: rawFields = [], value, onChange, placeholder = 'Type to filter...', error = false, showKeyboardHint = false, className, ...props })=>{
10
11
  const inputRef = useRef(null);
11
12
  const containerRef = useRef(null);
12
13
  const buildingChipRef = useRef(null);
@@ -15,6 +16,9 @@ const FilterInput = ({ fields = [], value, onChange, placeholder = 'Type to filt
15
16
  if (el) chipRegistryRef.current.set(id, el);
16
17
  else chipRegistryRef.current.delete(id);
17
18
  }, []);
19
+ const fields = useMemo(()=>applyFieldPresets(rawFields), [
20
+ rawFields
21
+ ]);
18
22
  const { conditions, connectors, chips, upsertCondition, removeCondition, removeConditionAtIndex, clearAll, setConnectorValue } = useFilterInputExpression({
19
23
  fields,
20
24
  value,
@@ -1,5 +1,5 @@
1
1
  export { FilterInput, type FilterInputProps } from './FilterInput';
2
2
  export { FilterInputChip, type FilterInputChipProps } from './FilterInputField';
3
3
  export { FilterInputFieldMenu, type FilterInputFieldMenuProps, FilterInputOperatorMenu, type FilterInputOperatorMenuProps, FilterInputValueMenu, type FilterInputValueMenuProps, type ValueOption, } from './FilterInputMenu';
4
- export { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, type FilterParseError, isFilterParseError, parseExpression, type StatusCodeSuggestionsOptions, serializeExpression, } from './lib';
5
- export type { Condition, ExprNode, FieldMetadata, FieldType, FieldValueOption, FilterInputChipData, FilterInputChipVariant, FilterOperator, Group, } from './types';
4
+ export { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, type FilterParseError, isFilterParseError, parseExpression, serializeExpression, } from './lib';
5
+ export type { Condition, ExprNode, FieldMetadata, FieldPreset, FieldType, FieldValueOption, FilterInputChipData, FilterInputChipVariant, FilterOperator, Group, } from './types';
@@ -0,0 +1,8 @@
1
+ import type { FieldMetadata } from '../types';
2
+ /**
3
+ * Resolve `FieldMetadata.preset` into concrete helpers. Consumer-supplied
4
+ * callbacks (`acceptChar` / `normalize` / `getSuggestions` / `validate`)
5
+ * always win over the preset so individual fields can still override parts
6
+ * of a preset when needed.
7
+ */
8
+ export declare const applyFieldPresets: (fields: FieldMetadata[]) => FieldMetadata[];
@@ -0,0 +1,27 @@
1
+ import { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator } from "./statusCode/index.js";
2
+ const PRESET_HELPERS = {
3
+ status_code: ()=>({
4
+ acceptChar: createStatusCodeInputFilter(),
5
+ normalize: createStatusCodeNormalizer(),
6
+ getSuggestions: createStatusCodeSuggestions(),
7
+ validate: createStatusCodeValidator()
8
+ })
9
+ };
10
+ const applyFieldPresets = (fields)=>{
11
+ let changed = false;
12
+ const out = fields.map((field)=>{
13
+ if (!field.preset) return field;
14
+ const helpers = PRESET_HELPERS[field.preset]?.();
15
+ if (!helpers) return field;
16
+ changed = true;
17
+ return {
18
+ ...field,
19
+ acceptChar: field.acceptChar ?? helpers.acceptChar,
20
+ normalize: field.normalize ?? helpers.normalize,
21
+ getSuggestions: field.getSuggestions ?? helpers.getSuggestions,
22
+ validate: field.validate ?? helpers.validate
23
+ };
24
+ });
25
+ return changed ? out : fields;
26
+ };
27
+ export { applyFieldPresets };
@@ -1,6 +1,7 @@
1
1
  export type { DatePreset } from '../FilterInputMenu/FilterInputDateValueMenu/constants';
2
2
  export { DATE_PRESETS, formatDateForChip, getDateDisplayLabel, isDatePreset, } from '../FilterInputMenu/FilterInputDateValueMenu/constants';
3
3
  export { applyAcceptChar } from './applyAcceptChar';
4
+ export { applyFieldPresets } from './applyFieldPresets';
4
5
  export { chipIdToConditionIndex, findChipSplitIndex } from './conditions';
5
6
  export { CONNECTOR_ID_PATTERN, NO_VALUE_OPERATORS, OPERATOR_LABELS, OPERATOR_LABELS_BY_TYPE, OPERATOR_SYMBOLS, OPERATORS_BY_TYPE, QUERY_BAR_SELECTOR, VARIANT_LABELS, } from './constants';
6
7
  export { buildContainerAnchoredRect, isMenuRelated } from './dom';
@@ -10,4 +11,4 @@ export { getCurrentValueTokenText, getValueFilterText } from './menuFilterText';
10
11
  export { getOperatorFromLabel, getOperatorLabel, isBetweenOperator, isMultiSelectOperator, isNoValueOperator, } from './operators';
11
12
  export { type FilterParseError, isFilterParseError, parseExpression } from './parseExpression';
12
13
  export { serializeExpression } from './serializeExpression';
13
- export { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, type StatusCodeSuggestionsOptions, } from './statusCode';
14
+ export { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, } from './statusCode';
@@ -1,5 +1,6 @@
1
1
  import { DATE_PRESETS, formatDateForChip, getDateDisplayLabel, isDatePreset } from "../FilterInputMenu/FilterInputDateValueMenu/constants.js";
2
2
  import { applyAcceptChar } from "./applyAcceptChar.js";
3
+ import { applyFieldPresets } from "./applyFieldPresets.js";
3
4
  import { chipIdToConditionIndex, findChipSplitIndex } from "./conditions.js";
4
5
  import { CONNECTOR_ID_PATTERN, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, OPERATOR_LABELS, OPERATOR_LABELS_BY_TYPE, OPERATOR_SYMBOLS, QUERY_BAR_SELECTOR, VARIANT_LABELS } from "./constants.js";
5
6
  import { buildContainerAnchoredRect, isMenuRelated } from "./dom.js";
@@ -10,4 +11,4 @@ import { getOperatorFromLabel, getOperatorLabel, isBetweenOperator, isMultiSelec
10
11
  import { isFilterParseError, parseExpression } from "./parseExpression/index.js";
11
12
  import { serializeExpression } from "./serializeExpression.js";
12
13
  import { createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator } from "./statusCode/index.js";
13
- export { CONNECTOR_ID_PATTERN, DATE_PRESETS, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, OPERATOR_LABELS, OPERATOR_LABELS_BY_TYPE, OPERATOR_SYMBOLS, QUERY_BAR_SELECTOR, VARIANT_LABELS, applyAcceptChar, buildContainerAnchoredRect, chipIdToConditionIndex, createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, filterAndSort, findChipSplitIndex, formatDateForChip, getCurrentValueTokenText, getDateDisplayLabel, getFieldValues, getOperatorFromLabel, getOperatorLabel, getValueFilterText, hasFieldValues, hasStaticAllowlist, isBetweenOperator, isDatePreset, isFilterParseError, isMenuRelated, isMultiSelectOperator, isNoValueOperator, parseExpression, serializeExpression };
14
+ export { CONNECTOR_ID_PATTERN, DATE_PRESETS, NO_VALUE_OPERATORS, OPERATORS_BY_TYPE, OPERATOR_LABELS, OPERATOR_LABELS_BY_TYPE, OPERATOR_SYMBOLS, QUERY_BAR_SELECTOR, VARIANT_LABELS, applyAcceptChar, applyFieldPresets, buildContainerAnchoredRect, chipIdToConditionIndex, createStatusCodeInputFilter, createStatusCodeNormalizer, createStatusCodeSuggestions, createStatusCodeValidator, filterAndSort, findChipSplitIndex, formatDateForChip, getCurrentValueTokenText, getDateDisplayLabel, getFieldValues, getOperatorFromLabel, getOperatorLabel, getValueFilterText, hasFieldValues, hasStaticAllowlist, isBetweenOperator, isDatePreset, isFilterParseError, isMenuRelated, isMultiSelectOperator, isNoValueOperator, parseExpression, serializeExpression };
@@ -1,16 +1,17 @@
1
1
  import type { FieldValueOption } from '../../types';
2
- import { type StatusCodeSuggestionsOptions } from './utils';
3
2
  /**
4
3
  * Build the `getSuggestions` callback for an HTTP status code field. The
5
4
  * returned function:
6
- * - reads the active `maskRoots` from `options.codes`
7
- * - on empty input, offers every available class mask
5
+ * - on empty input, offers every HTTP class mask (`1XX..5XX`)
8
6
  * - on partial input (`"3"`, `"3X"`, `"30"`, …), expands it via
9
7
  * `canonicalizeStatusCodeInput` and offers the single matching mask
10
8
  * - merges any `context.selectedValues` (values already committed to the
11
9
  * chip) in front of the input-driven output so they always appear with
12
10
  * their canonical badge styling
11
+ *
12
+ * No backend config is required — the status-code class range is fixed to
13
+ * `[1..5]` per the HTTP spec.
13
14
  */
14
- export declare const createStatusCodeSuggestions: (options?: StatusCodeSuggestionsOptions) => ((inputText: string, context?: {
15
+ export declare const createStatusCodeSuggestions: () => ((inputText: string, context?: {
15
16
  selectedValues?: Array<string | number | boolean>;
16
17
  }) => FieldValueOption[]);
@@ -1,7 +1,6 @@
1
- import { canonicalizeStatusCodeInput, getMaskRoots, makeMask } from "./utils/index.js";
2
- const createStatusCodeSuggestions = (options)=>{
3
- const maskRoots = getMaskRoots(options?.codes);
4
- const resolveSelected = (selectedValues)=>(selectedValues ?? []).map((v)=>String(v)).filter((s)=>/^\d[\dX]{0,2}$/.test(s) && maskRoots.includes(s.charAt(0))).map((s)=>makeMask(s));
1
+ import { MASK_ROOTS, canonicalizeStatusCodeInput, makeMask } from "./utils/index.js";
2
+ const createStatusCodeSuggestions = ()=>{
3
+ const resolveSelected = (selectedValues)=>(selectedValues ?? []).map((v)=>String(v)).filter((s)=>/^\d[\dX]{0,2}$/.test(s) && MASK_ROOTS.includes(s.charAt(0))).map((s)=>makeMask(s));
5
4
  return (inputText, context)=>{
6
5
  const norm = inputText.trim();
7
6
  const selected = resolveSelected(context?.selectedValues);
@@ -10,8 +9,8 @@ const createStatusCodeSuggestions = (options)=>{
10
9
  ...selected,
11
10
  ...primary.filter((o)=>!seen.has(String(o.value)))
12
11
  ];
13
- if (0 === norm.length) return merge(maskRoots.map((d)=>makeMask(`${d}XX`)));
14
- const mask = canonicalizeStatusCodeInput(norm, maskRoots);
12
+ if (0 === norm.length) return merge(MASK_ROOTS.map((d)=>makeMask(`${d}XX`)));
13
+ const mask = canonicalizeStatusCodeInput(norm);
15
14
  if (!mask) return selected;
16
15
  return merge([
17
16
  makeMask(mask)
@@ -1,4 +1,3 @@
1
- import { type StatusCodeSuggestionsOptions } from './utils';
2
1
  /**
3
2
  * Build a validator for the HTTP status code field. Accepts only 3-character
4
3
  * values whose leading digit is a valid HTTP class (`[1..5]`) and whose
@@ -9,11 +8,5 @@ import { type StatusCodeSuggestionsOptions } from './utils';
9
8
  *
10
9
  * Returns `true` when the value is invalid, matching the
11
10
  * `FieldMetadata.validate` contract.
12
- *
13
- * The `options` argument is accepted for API symmetry with
14
- * `createStatusCodeSuggestions` (same wiring on the field), but validity is
15
- * bound to the static `[1..5]` HTTP class range rather than `codes` — the
16
- * backend's available-data list doesn't narrow what the user may legitimately
17
- * type.
18
11
  */
19
- export declare const createStatusCodeValidator: (_options?: StatusCodeSuggestionsOptions) => ((value: string | number | boolean) => boolean);
12
+ export declare const createStatusCodeValidator: () => ((value: string | number | boolean) => boolean);
@@ -1,8 +1,8 @@
1
- import { STATUS_CODE_LENGTH, VALID_MASK_ROOTS } from "./utils/index.js";
2
- const createStatusCodeValidator = (_options)=>(value)=>{
1
+ import { MASK_ROOTS, STATUS_CODE_LENGTH } from "./utils/index.js";
2
+ const createStatusCodeValidator = ()=>(value)=>{
3
3
  const s = String(value);
4
4
  if (s.length !== STATUS_CODE_LENGTH) return true;
5
- if (!VALID_MASK_ROOTS.has(s.charAt(0))) return true;
5
+ if (!MASK_ROOTS.includes(s.charAt(0))) return true;
6
6
  return !/^(XX|\dX|\d\d)$/.test(s.slice(1));
7
7
  };
8
8
  export { createStatusCodeValidator };
@@ -2,4 +2,3 @@ export { createStatusCodeInputFilter } from './createStatusCodeInputFilter';
2
2
  export { createStatusCodeNormalizer } from './createStatusCodeNormalizer';
3
3
  export { createStatusCodeSuggestions } from './createStatusCodeSuggestions';
4
4
  export { createStatusCodeValidator } from './createStatusCodeValidator';
5
- export type { StatusCodeSuggestionsOptions } from './utils';
@@ -14,7 +14,7 @@
14
14
  * Rejected:
15
15
  * "3X0" (digit after placeholder)
16
16
  * "X30" (starts with placeholder)
17
- * "6..." (leading digit not in `maskRoots`)
17
+ * "6..." (leading digit outside the `[1..5]` HTTP class range)
18
18
  * "ab..." (non-digit, non-X)
19
19
  */
20
- export declare const canonicalizeStatusCodeInput: (input: string, maskRoots: string[]) => string | null;
20
+ export declare const canonicalizeStatusCodeInput: (input: string) => string | null;
@@ -1,10 +1,10 @@
1
- import { MASK_PLACEHOLDER, STATUS_CODE_LENGTH } from "./constants.js";
2
- const canonicalizeStatusCodeInput = (input, maskRoots)=>{
1
+ import { MASK_PLACEHOLDER, MASK_ROOTS, STATUS_CODE_LENGTH } from "./constants.js";
2
+ const canonicalizeStatusCodeInput = (input)=>{
3
3
  const s = input.toUpperCase();
4
4
  if (0 === s.length || s.length > STATUS_CODE_LENGTH) return null;
5
5
  if (!/^[\dX]+$/.test(s)) return null;
6
6
  const d1 = s.charAt(0);
7
- if (d1 === MASK_PLACEHOLDER || !maskRoots.includes(d1)) return null;
7
+ if (d1 === MASK_PLACEHOLDER || !MASK_ROOTS.includes(d1)) return null;
8
8
  if (1 === s.length) return `${d1}XX`;
9
9
  const c2 = s.charAt(1);
10
10
  if (c2 === MASK_PLACEHOLDER) {
@@ -1,8 +1,12 @@
1
1
  import type { BadgeColor } from '../../../../Badge';
2
2
  /** The five valid HTTP status-code classes, used both for suggestion-building
3
- * and validation. Backed by the standard HTTP spec, independent of what the
4
- * backend happens to carry. */
5
- export declare const VALID_MASK_ROOTS: Set<string>;
3
+ * and validation. Backed by the standard HTTP spec entirely frontend-driven,
4
+ * independent of what the backend config carries.
5
+ *
6
+ * Typed as `readonly string[]` (not `as const`) so `.includes(someString)`
7
+ * stays callable without casting; declaration-file generation rejects the
8
+ * tuple-narrowed overload of `.includes`. */
9
+ export declare const MASK_ROOTS: readonly string[];
6
10
  /** Badge color per HTTP class, keyed by the leading digit. Derived from the
7
11
  * AS-877 Figma designs: informational greys, success greens, redirect blues,
8
12
  * client-error ambers, server-error reds. */
@@ -1,10 +1,10 @@
1
- const VALID_MASK_ROOTS = new Set([
1
+ const MASK_ROOTS = [
2
2
  '1',
3
3
  '2',
4
4
  '3',
5
5
  '4',
6
6
  '5'
7
- ]);
7
+ ];
8
8
  const HTTP_CLASS_BADGE_COLOR = {
9
9
  1: 'slate',
10
10
  2: 'green',
@@ -14,4 +14,4 @@ const HTTP_CLASS_BADGE_COLOR = {
14
14
  };
15
15
  const STATUS_CODE_LENGTH = 3;
16
16
  const MASK_PLACEHOLDER = 'X';
17
- export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, STATUS_CODE_LENGTH, VALID_MASK_ROOTS };
17
+ export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, MASK_ROOTS, STATUS_CODE_LENGTH };
@@ -1,5 +1,3 @@
1
1
  export { canonicalizeStatusCodeInput } from './canonicalize';
2
- export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, STATUS_CODE_LENGTH, VALID_MASK_ROOTS, } from './constants';
2
+ export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, MASK_ROOTS, STATUS_CODE_LENGTH, } from './constants';
3
3
  export { makeMask } from './makeMask';
4
- export { getMaskRoots } from './maskRoots';
5
- export type { StatusCodeSuggestionsOptions } from './types';
@@ -1,5 +1,4 @@
1
1
  import { canonicalizeStatusCodeInput } from "./canonicalize.js";
2
- import { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, STATUS_CODE_LENGTH, VALID_MASK_ROOTS } from "./constants.js";
2
+ import { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, MASK_ROOTS, STATUS_CODE_LENGTH } from "./constants.js";
3
3
  import { makeMask } from "./makeMask.js";
4
- import { getMaskRoots } from "./maskRoots.js";
5
- export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, STATUS_CODE_LENGTH, VALID_MASK_ROOTS, canonicalizeStatusCodeInput, getMaskRoots, makeMask };
4
+ export { HTTP_CLASS_BADGE_COLOR, MASK_PLACEHOLDER, MASK_ROOTS, STATUS_CODE_LENGTH, canonicalizeStatusCodeInput, makeMask };
@@ -44,6 +44,13 @@ export interface FieldValueOption {
44
44
  text: string;
45
45
  };
46
46
  }
47
+ /**
48
+ * Built-in field presets. Setting `preset` on a `FieldMetadata` wires the
49
+ * corresponding factory helpers into `acceptChar` / `normalize` /
50
+ * `getSuggestions` / `validate` automatically. Consumer-supplied callbacks
51
+ * always win over the preset.
52
+ */
53
+ export type FieldPreset = 'status_code';
47
54
  /**
48
55
  * Field Metadata Interface
49
56
  * Matches backend structure for field definitions
@@ -56,6 +63,12 @@ export interface FieldMetadata {
56
63
  operators?: FilterOperator[];
57
64
  default?: string | number | boolean;
58
65
  values?: FieldValueOption[];
66
+ /**
67
+ * Built-in DS preset that wires masking / validation / suggestions without
68
+ * requiring the consumer to import the factory helpers themselves. Any
69
+ * callback explicitly provided on this `FieldMetadata` wins over the preset.
70
+ */
71
+ preset?: FieldPreset;
59
72
  /**
60
73
  * Shorthand for simple string values (e.g. `["GET", "POST", "PUT"]`).
61
74
  * Automatically converted to `FieldValueOption[]` where `value === label`.
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "0.26.0",
3
- "generatedAt": "2026-04-20T13:27:55.627Z",
2
+ "version": "0.27.0",
3
+ "generatedAt": "2026-04-20T14:56:46.717Z",
4
4
  "components": [
5
5
  {
6
6
  "name": "Alert",
@@ -15197,8 +15197,7 @@
15197
15197
  {
15198
15198
  "name": "fields",
15199
15199
  "type": "FieldMetadata[] | undefined",
15200
- "required": false,
15201
- "defaultValue": "[]"
15200
+ "required": false
15202
15201
  },
15203
15202
  {
15204
15203
  "name": "value",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wallarm-org/design-system",
3
- "version": "0.27.0",
3
+ "version": "1.0.0-rc-feature-AS-877-fix-filter-code.2",
4
4
  "description": "Core design system library with React components and Storybook documentation",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,4 +0,0 @@
1
- /** Extract the HTTP class digits (`1`..`5`) that actually appear as single-
2
- * character entries in the backend `codes` list. These become the "available"
3
- * class masks the helper is willing to emit. */
4
- export declare const getMaskRoots: (codes: string[] | undefined) => string[];
@@ -1,3 +0,0 @@
1
- import { VALID_MASK_ROOTS } from "./constants.js";
2
- const getMaskRoots = (codes)=>(codes ?? []).filter((c)=>1 === c.length && VALID_MASK_ROOTS.has(c));
3
- export { getMaskRoots };
@@ -1,8 +0,0 @@
1
- export interface StatusCodeSuggestionsOptions {
2
- /**
3
- * Raw backend status-code list. The helper keeps only 1-char entries in
4
- * `[1..5]` as mask roots; everything else is ignored. When omitted or
5
- * empty, the helper returns `[]` for every input.
6
- */
7
- codes?: string[];
8
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Example HTTP status code backend response used by FilterInput stories.
3
- * Mixes 1-char HTTP classes with 3-char concrete codes — the same shape the
4
- * real backend produces. See AS-877 design spec.
5
- */
6
- export declare const MOCK_STATUS_CODES: string[];
@@ -1,20 +0,0 @@
1
- const MOCK_STATUS_CODES = [
2
- '1',
3
- '2',
4
- '3',
5
- '4',
6
- '5',
7
- '101',
8
- '200',
9
- '201',
10
- '301',
11
- '302',
12
- '400',
13
- '401',
14
- '403',
15
- '404',
16
- '500',
17
- '502',
18
- '503'
19
- ];
20
- export { MOCK_STATUS_CODES };