@postenbring/hedwig-react 4.2.1 → 4.3.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.
Files changed (64) hide show
  1. package/dist/chunk-5J5LYE6Z.mjs +1 -0
  2. package/dist/chunk-6D5VE3DW.mjs +44 -0
  3. package/dist/chunk-6D5VE3DW.mjs.map +1 -0
  4. package/dist/{chunk-WMSOBRKN.mjs → chunk-DOW6EHBI.mjs} +2 -2
  5. package/dist/chunk-FTVKPZCX.mjs +37 -0
  6. package/dist/chunk-FTVKPZCX.mjs.map +1 -0
  7. package/dist/chunk-HA3LRSDK.mjs +21 -0
  8. package/dist/chunk-HA3LRSDK.mjs.map +1 -0
  9. package/dist/{chunk-JKKH77UC.mjs → chunk-JGYPZ7ET.mjs} +2 -2
  10. package/dist/{chunk-SQNGMF3D.mjs → chunk-QER35NXN.mjs} +5 -5
  11. package/dist/{chunk-DNCWDWK2.mjs → chunk-QOIBRXYT.mjs} +4 -4
  12. package/dist/chunk-XSID7YR7.mjs +1 -0
  13. package/dist/chunk-XSID7YR7.mjs.map +1 -0
  14. package/dist/form/checkbox/checkbox.mjs +3 -3
  15. package/dist/form/checkbox/index.mjs +3 -3
  16. package/dist/form/fieldset/fieldset.mjs +2 -2
  17. package/dist/form/fieldset/index.mjs +4 -4
  18. package/dist/form/index.d.ts +1 -0
  19. package/dist/form/index.d.ts.map +1 -1
  20. package/dist/form/index.js +82 -5
  21. package/dist/form/index.js.map +1 -1
  22. package/dist/form/index.mjs +35 -20
  23. package/dist/form/radio-button/index.mjs +4 -4
  24. package/dist/form/radio-button/radio-button.mjs +4 -4
  25. package/dist/form/radio-button/radio-group.mjs +3 -3
  26. package/dist/form/suggestions/index.d.ts +7 -0
  27. package/dist/form/suggestions/index.d.ts.map +1 -0
  28. package/dist/form/suggestions/index.js +131 -0
  29. package/dist/form/suggestions/index.js.map +1 -0
  30. package/dist/form/suggestions/index.mjs +19 -0
  31. package/dist/form/suggestions/index.mjs.map +1 -0
  32. package/dist/form/suggestions/suggestions-item.d.ts +45 -0
  33. package/dist/form/suggestions/suggestions-item.d.ts.map +1 -0
  34. package/dist/form/suggestions/suggestions-item.js +83 -0
  35. package/dist/form/suggestions/suggestions-item.js.map +1 -0
  36. package/dist/form/suggestions/suggestions-item.mjs +10 -0
  37. package/dist/form/suggestions/suggestions-item.mjs.map +1 -0
  38. package/dist/form/suggestions/suggestions-wrapper.d.ts +41 -0
  39. package/dist/form/suggestions/suggestions-wrapper.d.ts.map +1 -0
  40. package/dist/form/suggestions/suggestions-wrapper.js +66 -0
  41. package/dist/form/suggestions/suggestions-wrapper.js.map +1 -0
  42. package/dist/form/suggestions/suggestions-wrapper.mjs +8 -0
  43. package/dist/form/suggestions/suggestions-wrapper.mjs.map +1 -0
  44. package/dist/form/suggestions/suggestions.d.ts +57 -0
  45. package/dist/form/suggestions/suggestions.d.ts.map +1 -0
  46. package/dist/form/suggestions/suggestions.js +123 -0
  47. package/dist/form/suggestions/suggestions.js.map +1 -0
  48. package/dist/form/suggestions/suggestions.mjs +10 -0
  49. package/dist/form/suggestions/suggestions.mjs.map +1 -0
  50. package/dist/index.js +356 -279
  51. package/dist/index.js.map +1 -1
  52. package/dist/index.mjs +43 -28
  53. package/package.json +5 -5
  54. package/src/form/index.tsx +1 -0
  55. package/src/form/suggestions/index.tsx +6 -0
  56. package/src/form/suggestions/suggestions-item.tsx +70 -0
  57. package/src/form/suggestions/suggestions-wrapper.tsx +50 -0
  58. package/src/form/suggestions/suggestions.tsx +89 -0
  59. package/dist/chunk-CVE23PMJ.mjs +0 -1
  60. /package/dist/{chunk-CVE23PMJ.mjs.map → chunk-5J5LYE6Z.mjs.map} +0 -0
  61. /package/dist/{chunk-WMSOBRKN.mjs.map → chunk-DOW6EHBI.mjs.map} +0 -0
  62. /package/dist/{chunk-JKKH77UC.mjs.map → chunk-JGYPZ7ET.mjs.map} +0 -0
  63. /package/dist/{chunk-SQNGMF3D.mjs.map → chunk-QER35NXN.mjs.map} +0 -0
  64. /package/dist/{chunk-DNCWDWK2.mjs.map → chunk-QOIBRXYT.mjs.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/form/suggestions/suggestions.tsx","../../../src/form/suggestions/suggestions-wrapper.tsx","../../../src/form/suggestions/suggestions-item.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { HTMLAttributes, Ref } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { SuggestionsWrapper } from \"./suggestions-wrapper\";\nimport { SuggestionsItem, SuggestionsItemAction } from \"./suggestions-item\";\n\nexport type { SuggestionsItemActionProps, SuggestionsItemProps } from \"./suggestions-item\";\n\nexport interface SuggestionsProps extends HTMLAttributes<HTMLUListElement | HTMLOListElement> {\n /**\n * Change the rendered list element.\n *\n * @default \"ul\"\n */\n as?: \"ul\" | \"ol\";\n /**\n * Sets the size of the items\n *\n * @default \"default\"\n */\n size?: \"default\" | \"small\";\n}\n\nexport type SuggestionProps = SuggestionsProps;\n\n/**\n * A list of suggestions for the user while searching\n *\n * @example\n * ```tsx\n * <Suggestions>\n * <Suggestions.Item>\n * <Suggestions.ItemAction href=\"/\">\n * Albania\n * </Suggestions.ItemAction>\n * </Suggestions.Item>\n * <Suggestions.Item>\n * <Suggestions.ItemAction asChild>\n * <button type=\"button\">Select Albania</button>\n * </Suggestions.ItemAction>\n * </Suggestions.Item>\n * </Suggestions>\n * ```\n *\n * Use `as=\"ol\"` for ordered suggestions:\n * ```tsx\n * <Suggestions as=\"ol\">\n * <Suggestions.Item>\n* <Suggestions.ItemAction href=\"/\">\n* First result\n* </Suggestions.ItemAction>\n * </Suggestions.Item>\n * </Suggestions>\n * ```\n */\nexport const Suggestions = forwardRef<HTMLUListElement | HTMLOListElement, SuggestionProps>(\n ({ as = \"ul\", size = \"default\", className, ...rest }, ref) => {\n const classes = clsx(\n \"hds-suggestions\",\n size !== \"default\" && `hds-suggestions--${size}`,\n className as undefined,\n );\n\n return as === \"ol\" ? (\n <ol\n className={classes}\n ref={ref as Ref<HTMLOListElement>}\n {...(rest as HTMLAttributes<HTMLOListElement>)}\n />\n ) : (\n <ul className={classes} ref={ref as Ref<HTMLUListElement>} {...rest} />\n );\n },\n) as SuggestionsType;\n\ntype SuggestionsType = ReturnType<\n typeof forwardRef<HTMLUListElement | HTMLOListElement, SuggestionProps>\n> & {\n Item: typeof SuggestionsItem;\n ItemAction: typeof SuggestionsItemAction;\n Wrapper: typeof SuggestionsWrapper;\n};\n\nSuggestions.displayName = \"Suggestions\";\nSuggestionsItem.displayName = \"Suggestions.Item\";\nSuggestionsItemAction.displayName = \"Suggestions.ItemAction\";\nSuggestions.Item = SuggestionsItem;\nSuggestions.ItemAction = SuggestionsItemAction;\nSuggestions.Wrapper = SuggestionsWrapper;\n","import { forwardRef } from \"react\";\nimport type { HTMLAttributes } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\n\nexport interface SuggestionsWrapperProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Change the rendered element for the suggestions wrapper.\n *\n * @default \"div\"\n */\n as?: \"section\" | \"div\";\n}\n\n/**\n * A wrapper for search suggestions.\n * Intended to contain a SearchWrapper and Suggestions.\n *\n * @example\n * ```tsx\n * <Suggestions.Wrapper>\n * <SearchWrapper>\n * <Input type=\"search\" aria-label=\"Search content\" />\n * <Button>Search</Button>\n * <Button icon aria-label=\"Clear search\">\n * <XmarkIcon />\n * </Button>\n * </SearchWrapper>\n * <Suggestions>\n * <Suggestions.Item>\n * <Suggestions.ItemAction href=\"/\">Albania</Suggestions.ItemAction>\n * </Suggestions.Item>\n * </Suggestions>\n * </Suggestions.Wrapper>\n * ```\n *\n * Use `as` when the wrapper needs a different semantic element:\n * ```tsx\n * <Suggestions.Wrapper as=\"section\">\n * <SearchWrapper>...</SearchWrapper>\n * <Suggestions>...</Suggestions>\n * </Suggestions.Wrapper>\n * ```\n */\nexport const SuggestionsWrapper = forwardRef<HTMLDivElement, SuggestionsWrapperProps>(\n ({ as: Tag = \"div\", className, ...rest }, ref) => (\n <Tag className={clsx(\"hds-suggestions-wrapper\", className as undefined)} ref={ref} {...rest} />\n ),\n);\n\nSuggestionsWrapper.displayName = \"Suggestions.Wrapper\";\n","import { forwardRef } from \"react\";\nimport type { AnchorHTMLAttributes, HTMLAttributes, Ref } from \"react\";\nimport { clsx } from \"@postenbring/hedwig-css/typed-classname\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\nexport type SuggestionsItemProps = HTMLAttributes<HTMLLIElement>;\n\nexport interface SuggestionsItemActionProps extends AnchorHTMLAttributes<HTMLAnchorElement> {\n /**\n * Use the element passed as a child, merging its props and behavior.\n *\n * @default false\n */\n asChild?: boolean;\n}\n\n/**\n * A single structural item in a suggestions list.\n *\n * Use `Suggestions.ItemAction` as the interactive child of each item.\n *\n * @example\n * ```tsx\n * <Suggestions.Item>\n * <Suggestions.ItemAction href=\"/results\">\n * View results\n * </Suggestions.ItemAction>\n * </Suggestions.Item>\n * ```\n */\nexport const SuggestionsItem = forwardRef<HTMLLIElement, SuggestionsItemProps>(\n ({ className, ...rest }, ref) => (\n <li className={clsx(\"hds-suggestions-item\", className as undefined)} ref={ref} {...rest} />\n ),\n);\n\nSuggestionsItem.displayName = \"Suggestions.Item\";\n\n/**\n * The interactive action within a suggestions item.\n *\n * Renders an anchor by default and applies the `hds-suggestions-item__action`\n * class. Use `asChild` to render another interactive element, such as a button\n * or router link, while preserving the action styling.\n *\n * @example\n * ```tsx\n * <Suggestions.ItemAction href=\"/results\">\n * View results\n * </Suggestions.ItemAction>\n *\n * <Suggestions.ItemAction asChild>\n * <button type=\"button\">Select result</button>\n * </Suggestions.ItemAction>\n * ```\n */\nexport const SuggestionsItemAction = forwardRef<HTMLAnchorElement, SuggestionsItemActionProps>(\n ({ asChild, className, ...rest }, ref) => {\n const Component = asChild ? Slot : \"a\";\n return (\n <Component\n className={clsx(\"hds-suggestions-item__action\", className as undefined)}\n ref={ref as Ref<HT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7C,IAA6C,CAA3C,MAAW,QAAkB;AAC9B,UAAM,cAAU;AAAA,MACd;AAAA,MACA,SAAS,aAAa,oBAAoB,IAAI;AAAA,MAC9C;AAAA,IACF;AAEA,WAAO,OAAO,OACZ;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX;AAAA,SACK;AAAA,IACP,IAEA,6CAAC,uBAAG,WAAW,SAAS,OAAuC,KAAM;AAAA,EAEzE;AACF;AAUA,YAAY,cAAc;AAC1B,gBAAgB,cAAc;AAC9B,sBAAsB,cAAc;AACpC,YAAY,OAAO;AACnB,YAAY,aAAa;AACzB,YAAY,UAAU;","names":["import_react","import_typed_classname","import_react","import_typed_classname","import_jsx_runtime","import_jsx_runtime"]}
@@ -0,0 +1,10 @@
1
+ import {
2
+ Suggestions
3
+ } from "../../chunk-6D5VE3DW.mjs";
4
+ import "../../chunk-FTVKPZCX.mjs";
5
+ import "../../chunk-HA3LRSDK.mjs";
6
+ import "../../chunk-YOSPWY5K.mjs";
7
+ export {
8
+ Suggestions
9
+ };
10
+ //# sourceMappingURL=suggestions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}