@vjdesigns/vjdesigns-ui 3.7.0 → 3.8.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 (105) hide show
  1. package/CHANGELOG.md +204 -189
  2. package/README.md +854 -854
  3. package/dist/ai/llms-full.txt +784 -589
  4. package/dist/ai/llms.txt +4 -0
  5. package/dist/ai/registry.json +741 -17
  6. package/dist/components/data-display/Poll/Poll.cjs.js +1 -0
  7. package/dist/components/data-display/Poll/Poll.d.ts +114 -0
  8. package/dist/components/data-display/Poll/Poll.mjs +335 -0
  9. package/dist/components/data-display/Poll/Poll.module.css.cjs.js +1 -0
  10. package/dist/components/data-display/Poll/Poll.module.css.mjs +46 -0
  11. package/dist/components/data-display/Poll/index.d.ts +1 -0
  12. package/dist/components/data-display/RatingBreakdown/RatingBreakdown.cjs.js +1 -0
  13. package/dist/components/data-display/RatingBreakdown/RatingBreakdown.d.ts +35 -0
  14. package/dist/components/data-display/RatingBreakdown/RatingBreakdown.mjs +88 -0
  15. package/dist/components/data-display/RatingBreakdown/RatingBreakdown.module.css.cjs.js +1 -0
  16. package/dist/components/data-display/RatingBreakdown/RatingBreakdown.module.css.mjs +21 -0
  17. package/dist/components/data-display/RatingBreakdown/index.d.ts +1 -0
  18. package/dist/components/data-display/ReviewCard/ReviewCard.cjs.js +1 -0
  19. package/dist/components/data-display/ReviewCard/ReviewCard.d.ts +67 -0
  20. package/dist/components/data-display/ReviewCard/ReviewCard.mjs +174 -0
  21. package/dist/components/data-display/ReviewCard/ReviewCard.module.css.cjs.js +1 -0
  22. package/dist/components/data-display/ReviewCard/ReviewCard.module.css.mjs +26 -0
  23. package/dist/components/data-display/ReviewCard/index.d.ts +1 -0
  24. package/dist/components/forms/RatingScale/RatingScale.cjs.js +1 -0
  25. package/dist/components/forms/RatingScale/RatingScale.d.ts +106 -0
  26. package/dist/components/forms/RatingScale/RatingScale.mjs +175 -0
  27. package/dist/components/forms/RatingScale/RatingScale.module.css.cjs.js +1 -0
  28. package/dist/components/forms/RatingScale/RatingScale.module.css.mjs +28 -0
  29. package/dist/components/forms/RatingScale/index.d.ts +1 -0
  30. package/dist/components/navigation/MobileNav/MobileNav.module.css.cjs.js +1 -1
  31. package/dist/components/navigation/MobileNav/MobileNav.module.css.mjs +14 -14
  32. package/dist/components/primitives/Icon/icons.cjs.js +1 -1
  33. package/dist/components/primitives/Icon/icons.d.ts +70 -0
  34. package/dist/components/primitives/Icon/icons.mjs +203 -134
  35. package/dist/components/primitives/Typography/Typography.d.ts +2 -2
  36. package/dist/i18n/en.cjs.js +1 -1
  37. package/dist/i18n/en.mjs +161 -0
  38. package/dist/i18n/types.d.ts +171 -0
  39. package/dist/index.cjs.js +1 -1
  40. package/dist/index.d.ts +4 -0
  41. package/dist/index.mjs +111 -107
  42. package/dist/locales/ar.cjs.js +1 -1
  43. package/dist/locales/ar.mjs +196 -0
  44. package/dist/locales/bn.cjs.js +1 -1
  45. package/dist/locales/bn.mjs +131 -0
  46. package/dist/locales/cs.cjs.js +1 -1
  47. package/dist/locales/cs.mjs +181 -0
  48. package/dist/locales/da.cjs.js +1 -1
  49. package/dist/locales/da.mjs +161 -0
  50. package/dist/locales/de.cjs.js +1 -1
  51. package/dist/locales/de.mjs +161 -0
  52. package/dist/locales/el.cjs.js +1 -1
  53. package/dist/locales/el.mjs +161 -0
  54. package/dist/locales/es.cjs.js +1 -1
  55. package/dist/locales/es.mjs +161 -0
  56. package/dist/locales/fa.cjs.js +1 -1
  57. package/dist/locales/fa.mjs +131 -0
  58. package/dist/locales/fi.cjs.js +1 -1
  59. package/dist/locales/fi.mjs +161 -0
  60. package/dist/locales/fr.cjs.js +1 -1
  61. package/dist/locales/fr.mjs +166 -0
  62. package/dist/locales/he.cjs.js +1 -1
  63. package/dist/locales/he.mjs +171 -0
  64. package/dist/locales/hi.cjs.js +1 -1
  65. package/dist/locales/hi.mjs +161 -0
  66. package/dist/locales/hu.cjs.js +1 -1
  67. package/dist/locales/hu.mjs +131 -0
  68. package/dist/locales/id.cjs.js +1 -1
  69. package/dist/locales/id.mjs +131 -0
  70. package/dist/locales/it.cjs.js +1 -1
  71. package/dist/locales/it.mjs +166 -0
  72. package/dist/locales/ja.cjs.js +1 -1
  73. package/dist/locales/ja.mjs +131 -0
  74. package/dist/locales/ko.cjs.js +1 -1
  75. package/dist/locales/ko.mjs +131 -0
  76. package/dist/locales/nb.cjs.js +1 -1
  77. package/dist/locales/nb.mjs +161 -0
  78. package/dist/locales/nl.cjs.js +1 -1
  79. package/dist/locales/nl.mjs +161 -0
  80. package/dist/locales/pl.cjs.js +1 -1
  81. package/dist/locales/pl.mjs +181 -0
  82. package/dist/locales/pt-BR.cjs.js +1 -1
  83. package/dist/locales/pt-BR.mjs +166 -0
  84. package/dist/locales/ro.cjs.js +1 -1
  85. package/dist/locales/ro.mjs +171 -0
  86. package/dist/locales/ru.cjs.js +1 -1
  87. package/dist/locales/ru.mjs +181 -0
  88. package/dist/locales/sv.cjs.js +1 -1
  89. package/dist/locales/sv.mjs +161 -0
  90. package/dist/locales/th.cjs.js +1 -1
  91. package/dist/locales/th.mjs +131 -0
  92. package/dist/locales/tr.cjs.js +1 -1
  93. package/dist/locales/tr.mjs +131 -0
  94. package/dist/locales/uk.cjs.js +1 -1
  95. package/dist/locales/uk.mjs +181 -0
  96. package/dist/locales/ur.cjs.js +1 -1
  97. package/dist/locales/ur.mjs +161 -0
  98. package/dist/locales/vi.cjs.js +1 -1
  99. package/dist/locales/vi.mjs +131 -0
  100. package/dist/locales/zh-Hans.cjs.js +1 -1
  101. package/dist/locales/zh-Hans.mjs +131 -0
  102. package/dist/locales/zh-Hant.cjs.js +1 -1
  103. package/dist/locales/zh-Hant.mjs +131 -0
  104. package/dist/vjdesigns-ui.css +1 -1
  105. package/package.json +1 -1
@@ -0,0 +1,21 @@
1
+ // src/components/data-display/RatingBreakdown/RatingBreakdown.module.css
2
+ var e = "_sm_ab5yd_23", t = "_md_ab5yd_31", n = "_lg_ab5yd_39", r = "_breakdown_ab5yd_49", i = "_stacked_ab5yd_65", a = "_inline_ab5yd_73", o = "_levels_ab5yd_83", s = "_summary_ab5yd_91", c = "_average_ab5yd_105", l = "_basedOn_ab5yd_123", u = "_recommend_ab5yd_125", d = "_row_ab5yd_163", f = "_rowButton_ab5yd_183", p = "_levelLabel_ab5yd_243", m = "_track_ab5yd_273", h = "_fill_ab5yd_289", g = "_percent_ab5yd_319", _ = {
3
+ sm: e,
4
+ md: t,
5
+ lg: n,
6
+ breakdown: r,
7
+ stacked: i,
8
+ inline: a,
9
+ levels: o,
10
+ summary: s,
11
+ average: c,
12
+ basedOn: l,
13
+ recommend: u,
14
+ row: d,
15
+ rowButton: f,
16
+ levelLabel: p,
17
+ track: m,
18
+ fill: h,
19
+ percent: g
20
+ };
21
+ export { c as average, l as basedOn, r as breakdown, _ as default, h as fill, a as inline, p as levelLabel, o as levels, n as lg, t as md, g as percent, u as recommend, d as row, f as rowButton, e as sm, i as stacked, s as summary, m as track };
@@ -0,0 +1 @@
1
+ export * from './RatingBreakdown';
@@ -0,0 +1 @@
1
+ "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useElementObservers.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../forms/Rating/Rating.cjs.js"),i=require("../../primitives/Button/Button.cjs.js"),a=require("../../primitives/Icon/icons.cjs.js"),o=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),s=require("../Avatar/Avatar.cjs.js"),c=require("../Badge/Badge.cjs.js"),l=require("./ReviewCard.module.css.cjs.js");let u=require("react"),d=require("react/jsx-runtime");function f(e,t){let n=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e),r=n?new Date(Number(n[1]),Number(n[2])-1,Number(n[3])):new Date(e);return Number.isNaN(r.getTime())?e:new Intl.DateTimeFormat(t,{dateStyle:`medium`}).format(r)}function p({author:p,rating:m,max:h=5,title:g,headingLevel:_=3,date:v,verified:y=!1,verifiedLabel:b,recommend:x,children:S,maxLines:C=5,media:w,helpfulCount:T,helpful:E,defaultHelpful:D=null,onHelpfulChange:O,response:k,actions:A,className:j,...M}){let{messages:N,locale:P}=o.useLocale(),F=N.reviewCard,I=(0,u.useId)(),L=`${I}-title`,R=`${I}-author`,z=`${I}-body`,B=`h${_}`,[V,H]=e.useControllableState({value:E,defaultValue:D,onChange:O}),[U,W]=(0,u.useState)(!1),[G,K]=(0,u.useState)(!1),{ref:q,width:J}=t.useElementSize(),[Y,X]=(0,u.useState)(null),Z=C>0;(0,u.useEffect)(()=>{Z&&Y&&!U&&K(Y.scrollHeight>Y.clientHeight+1)},[Z,Y,J,U,S]);let Q=T!==void 0||O!==void 0||A!==void 0;return(0,d.jsxs)(`article`,{"aria-labelledby":g===void 0?R:L,...M,className:n.cx(l.default.card,j),children:[(0,d.jsxs)(`header`,{className:l.default.header,children:[(0,d.jsx)(s.Avatar,{src:p.avatarSrc,name:p.name,size:`md`,decorative:!0}),(0,d.jsxs)(`div`,{className:l.default.who,children:[(0,d.jsx)(`span`,{id:R,className:l.default.author,children:p.name}),p.meta!==void 0&&(0,d.jsx)(`span`,{className:l.default.meta,children:p.meta})]}),v!==void 0&&(0,d.jsx)(`time`,{className:l.default.date,dateTime:v,children:f(v,P)})]}),(m!==void 0||y)&&(0,d.jsxs)(`div`,{className:l.default.ratingRow,children:[m!==void 0&&(0,d.jsx)(r.RatingDisplay,{value:m,max:h,size:`sm`}),y&&(0,d.jsx)(c.Badge,{tone:`success`,variant:`soft`,size:`sm`,startIcon:(0,d.jsx)(a.VerifiedIcon,{}),children:b??F.verified})]}),g!==void 0&&(0,d.jsx)(B,{id:L,className:l.default.title,children:g}),S!=null&&(0,d.jsxs)(`div`,{className:l.default.bodyWrap,children:[(0,d.jsx)(`div`,{id:z,ref:e=>{q(e),X(e)},className:l.default.body,"data-clamped":Z&&!U||void 0,style:{"--review-lines":C},children:S}),Z&&(G||U)&&(0,d.jsx)(i.Button,{variant:`link`,size:`sm`,className:l.default.more,"aria-expanded":U,"aria-controls":z,onClick:()=>W(e=>!e),children:U?F.readLess:F.readMore})]}),w!==void 0&&(0,d.jsx)(`div`,{className:l.default.media,children:w}),x!==void 0&&(0,d.jsxs)(`p`,{className:l.default.recommend,"data-recommend":x?`yes`:`no`,children:[x?(0,d.jsx)(a.ThumbsUpIcon,{"aria-hidden":`true`}):(0,d.jsx)(a.ThumbsDownIcon,{"aria-hidden":`true`}),x?F.recommends:F.doesNotRecommend]}),k!==void 0&&(0,d.jsxs)(`div`,{className:l.default.response,children:[(0,d.jsxs)(`p`,{className:l.default.responseTitle,children:[(0,d.jsx)(`span`,{children:F.response(k.author)}),k.date!==void 0&&(0,d.jsxs)(d.Fragment,{children:[` · `,(0,d.jsx)(`time`,{dateTime:k.date,className:l.default.responseDate,children:f(k.date,P)})]})]}),(0,d.jsx)(`div`,{className:l.default.responseBody,children:k.body})]}),Q&&(0,d.jsxs)(`footer`,{className:l.default.footer,children:[O!==void 0&&(0,d.jsxs)(`div`,{role:`group`,"aria-labelledby":`${I}-helpful`,className:l.default.helpful,children:[(0,d.jsx)(`span`,{id:`${I}-helpful`,className:l.default.helpfulLabel,children:F.helpful}),(0,d.jsx)(i.Button,{variant:V===!0?`soft`:`outline`,size:`sm`,"aria-pressed":V===!0,startIcon:(0,d.jsx)(a.ThumbsUpIcon,{}),onClick:()=>H(V!==!0||null),children:F.helpfulYes}),(0,d.jsx)(i.Button,{variant:V===!1?`soft`:`outline`,size:`sm`,"aria-pressed":V===!1,startIcon:(0,d.jsx)(a.ThumbsDownIcon,{}),onClick:()=>H(V===!1&&null),children:F.helpfulNo})]}),T!==void 0&&T>0&&(0,d.jsx)(`span`,{className:l.default.helpfulCount,children:F.foundHelpful(T)}),A!==void 0&&(0,d.jsx)(`div`,{className:l.default.actions,children:A})]})]})}exports.ReviewCard=p;
@@ -0,0 +1,67 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ /** The reviewer. */
3
+ export interface ReviewAuthor {
4
+ /** Display name; also used for the avatar's initials and alt text. */
5
+ name: string;
6
+ /** Avatar image URL. Initials show when it is missing or fails. */
7
+ avatarSrc?: string;
8
+ /** Secondary line, e.g. "Seattle · 12 reviews". */
9
+ meta?: ReactNode;
10
+ }
11
+ /** An owner or seller reply shown under the review. */
12
+ export interface ReviewResponse {
13
+ /** Who replied, e.g. "Hoops Outfitters". */
14
+ author: string;
15
+ /** ISO date ("YYYY-MM-DD") of the reply. */
16
+ date?: string;
17
+ /** The reply text. */
18
+ body: ReactNode;
19
+ }
20
+ export interface ReviewCardProps extends Omit<ComponentPropsWithRef<"article">, "title"> {
21
+ /** The reviewer. */
22
+ author: ReviewAuthor;
23
+ /** Star rating, shown with `RatingDisplay`. Omit for a text-only review. */
24
+ rating?: number;
25
+ /** Highest rating. @default 5 */
26
+ max?: number;
27
+ /** Review headline, rendered as a heading (see `headingLevel`). */
28
+ title?: ReactNode;
29
+ /** Heading level of `title`. @default 3 */
30
+ headingLevel?: 2 | 3 | 4 | 5 | 6;
31
+ /** ISO date ("YYYY-MM-DD") the review was written. Formatted for the locale in a `<time>`. */
32
+ date?: string;
33
+ /** Show a "Verified purchase" badge. @default false */
34
+ verified?: boolean;
35
+ /** Text of the verified badge, e.g. "Verified attendee". @default "Verified purchase" */
36
+ verifiedLabel?: string;
37
+ /** `true`: thumbs up "Recommends". `false`: thumbs down "Doesn't recommend". Omit to show neither. */
38
+ recommend?: boolean;
39
+ /** The review body. Long text is clamped to `maxLines` with a "Read more" button. */
40
+ children?: ReactNode;
41
+ /** Lines shown before "Read more". `0` never clamps. @default 5 */
42
+ maxLines?: number;
43
+ /** Photos or other media, shown under the body. */
44
+ media?: ReactNode;
45
+ /** How many people found the review helpful. Shown as "12 people found this helpful". */
46
+ helpfulCount?: number;
47
+ /** The viewer's helpful vote (controlled): `true` yes, `false` no, `null` none. */
48
+ helpful?: boolean | null;
49
+ /** Initial helpful vote (uncontrolled). @default null */
50
+ defaultHelpful?: boolean | null;
51
+ /**
52
+ * Called with the viewer's helpful vote. Setting it shows "Helpful? Yes / No"
53
+ * toggle buttons; pressing the pressed one again clears it (`null`).
54
+ */
55
+ onHelpfulChange?: (helpful: boolean | null) => void;
56
+ /** An owner or seller reply, shown indented under the review. */
57
+ response?: ReviewResponse;
58
+ /** Extra actions in the footer, e.g. Report or Share buttons. */
59
+ actions?: ReactNode;
60
+ }
61
+ /**
62
+ * One customer review: the reviewer with avatar, star rating, date,
63
+ * verified badge, headline, body (clamped with "Read more"), a would-
64
+ * recommend indicator, photos, helpful votes, and an owner reply. Rendered
65
+ * as an `<article>` named by its headline (or the reviewer).
66
+ */
67
+ export declare function ReviewCard({ author, rating, max, title, headingLevel, date, verified, verifiedLabel, recommend, children, maxLines, media, helpfulCount, helpful: helpfulProp, defaultHelpful, onHelpfulChange, response, actions, className, ...rest }: ReviewCardProps): import("react").JSX.Element;
@@ -0,0 +1,174 @@
1
+ "use client";
2
+ import { useControllableState as e } from "../../../hooks/useControllableState.mjs";
3
+ import { useElementSize as t } from "../../../hooks/useElementObservers.mjs";
4
+ import { cx as n } from "../../../utils/cx.mjs";
5
+ import { RatingDisplay as r } from "../../forms/Rating/Rating.mjs";
6
+ import { Button as i } from "../../primitives/Button/Button.mjs";
7
+ import { ThumbsDownIcon as a, ThumbsUpIcon as o, VerifiedIcon as s } from "../../primitives/Icon/icons.mjs";
8
+ import { useLocale as c } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
9
+ import { Avatar as l } from "../Avatar/Avatar.mjs";
10
+ import { Badge as u } from "../Badge/Badge.mjs";
11
+ import d from "./ReviewCard.module.css.mjs";
12
+ import { useEffect as f, useId as p, useState as m } from "react";
13
+ import { Fragment as ee, jsx as h, jsxs as g } from "react/jsx-runtime";
14
+ // src/components/data-display/ReviewCard/ReviewCard.tsx
15
+ function _(e, t) {
16
+ let n = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e), r = n ? new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3])) : new Date(e);
17
+ return Number.isNaN(r.getTime()) ? e : new Intl.DateTimeFormat(t, { dateStyle: "medium" }).format(r);
18
+ }
19
+ function v({ author: v, rating: y, max: b = 5, title: x, headingLevel: S = 3, date: C, verified: w = !1, verifiedLabel: T, recommend: E, children: D, maxLines: O = 5, media: k, helpfulCount: A, helpful: j, defaultHelpful: M = null, onHelpfulChange: N, response: P, actions: F, className: te, ...I }) {
20
+ let { messages: L, locale: R } = c(), z = L.reviewCard, B = p(), V = `${B}-title`, H = `${B}-author`, U = `${B}-body`, W = `h${S}`, [G, K] = e({
21
+ value: j,
22
+ defaultValue: M,
23
+ onChange: N
24
+ }), [q, J] = m(!1), [Y, X] = m(!1), { ref: Z, width: ne } = t(), [Q, re] = m(null), $ = O > 0;
25
+ f(() => {
26
+ $ && Q && !q && X(Q.scrollHeight > Q.clientHeight + 1);
27
+ }, [
28
+ $,
29
+ Q,
30
+ ne,
31
+ q,
32
+ D
33
+ ]);
34
+ let ie = A !== void 0 || N !== void 0 || F !== void 0;
35
+ return /* @__PURE__ */ g("article", {
36
+ "aria-labelledby": x === void 0 ? H : V,
37
+ ...I,
38
+ className: n(d.card, te),
39
+ children: [
40
+ /* @__PURE__ */ g("header", {
41
+ className: d.header,
42
+ children: [
43
+ /* @__PURE__ */ h(l, {
44
+ src: v.avatarSrc,
45
+ name: v.name,
46
+ size: "md",
47
+ decorative: !0
48
+ }),
49
+ /* @__PURE__ */ g("div", {
50
+ className: d.who,
51
+ children: [/* @__PURE__ */ h("span", {
52
+ id: H,
53
+ className: d.author,
54
+ children: v.name
55
+ }), v.meta !== void 0 && /* @__PURE__ */ h("span", {
56
+ className: d.meta,
57
+ children: v.meta
58
+ })]
59
+ }),
60
+ C !== void 0 && /* @__PURE__ */ h("time", {
61
+ className: d.date,
62
+ dateTime: C,
63
+ children: _(C, R)
64
+ })
65
+ ]
66
+ }),
67
+ (y !== void 0 || w) && /* @__PURE__ */ g("div", {
68
+ className: d.ratingRow,
69
+ children: [y !== void 0 && /* @__PURE__ */ h(r, {
70
+ value: y,
71
+ max: b,
72
+ size: "sm"
73
+ }), w && /* @__PURE__ */ h(u, {
74
+ tone: "success",
75
+ variant: "soft",
76
+ size: "sm",
77
+ startIcon: /* @__PURE__ */ h(s, {}),
78
+ children: T ?? z.verified
79
+ })]
80
+ }),
81
+ x !== void 0 && /* @__PURE__ */ h(W, {
82
+ id: V,
83
+ className: d.title,
84
+ children: x
85
+ }),
86
+ D != null && /* @__PURE__ */ g("div", {
87
+ className: d.bodyWrap,
88
+ children: [/* @__PURE__ */ h("div", {
89
+ id: U,
90
+ ref: (e) => {
91
+ Z(e), re(e);
92
+ },
93
+ className: d.body,
94
+ "data-clamped": $ && !q || void 0,
95
+ style: { "--review-lines": O },
96
+ children: D
97
+ }), $ && (Y || q) && /* @__PURE__ */ h(i, {
98
+ variant: "link",
99
+ size: "sm",
100
+ className: d.more,
101
+ "aria-expanded": q,
102
+ "aria-controls": U,
103
+ onClick: () => J((e) => !e),
104
+ children: q ? z.readLess : z.readMore
105
+ })]
106
+ }),
107
+ k !== void 0 && /* @__PURE__ */ h("div", {
108
+ className: d.media,
109
+ children: k
110
+ }),
111
+ E !== void 0 && /* @__PURE__ */ g("p", {
112
+ className: d.recommend,
113
+ "data-recommend": E ? "yes" : "no",
114
+ children: [h(E ? o : a, { "aria-hidden": "true" }), E ? z.recommends : z.doesNotRecommend]
115
+ }),
116
+ P !== void 0 && /* @__PURE__ */ g("div", {
117
+ className: d.response,
118
+ children: [/* @__PURE__ */ g("p", {
119
+ className: d.responseTitle,
120
+ children: [/* @__PURE__ */ h("span", { children: z.response(P.author) }), P.date !== void 0 && /* @__PURE__ */ g(ee, { children: [" · ", /* @__PURE__ */ h("time", {
121
+ dateTime: P.date,
122
+ className: d.responseDate,
123
+ children: _(P.date, R)
124
+ })] })]
125
+ }), /* @__PURE__ */ h("div", {
126
+ className: d.responseBody,
127
+ children: P.body
128
+ })]
129
+ }),
130
+ ie && /* @__PURE__ */ g("footer", {
131
+ className: d.footer,
132
+ children: [
133
+ N !== void 0 && /* @__PURE__ */ g("div", {
134
+ role: "group",
135
+ "aria-labelledby": `${B}-helpful`,
136
+ className: d.helpful,
137
+ children: [
138
+ /* @__PURE__ */ h("span", {
139
+ id: `${B}-helpful`,
140
+ className: d.helpfulLabel,
141
+ children: z.helpful
142
+ }),
143
+ /* @__PURE__ */ h(i, {
144
+ variant: G === !0 ? "soft" : "outline",
145
+ size: "sm",
146
+ "aria-pressed": G === !0,
147
+ startIcon: /* @__PURE__ */ h(o, {}),
148
+ onClick: () => K(G !== !0 || null),
149
+ children: z.helpfulYes
150
+ }),
151
+ /* @__PURE__ */ h(i, {
152
+ variant: G === !1 ? "soft" : "outline",
153
+ size: "sm",
154
+ "aria-pressed": G === !1,
155
+ startIcon: /* @__PURE__ */ h(a, {}),
156
+ onClick: () => K(G === !1 && null),
157
+ children: z.helpfulNo
158
+ })
159
+ ]
160
+ }),
161
+ A !== void 0 && A > 0 && /* @__PURE__ */ h("span", {
162
+ className: d.helpfulCount,
163
+ children: z.foundHelpful(A)
164
+ }),
165
+ F !== void 0 && /* @__PURE__ */ h("div", {
166
+ className: d.actions,
167
+ children: F
168
+ })
169
+ ]
170
+ })
171
+ ]
172
+ });
173
+ }
174
+ export { v as ReviewCard };
@@ -0,0 +1 @@
1
+ var e=`_card_lnd0v_23`,t=`_header_lnd0v_51`,n=`_who_lnd0v_65`,r=`_author_lnd0v_79`,i=`_meta_lnd0v_95`,a=`_date_lnd0v_97`,o=`_ratingRow_lnd0v_119`,s=`_title_lnd0v_133`,c=`_bodyWrap_lnd0v_151`,l=`_body_lnd0v_151`,u=`_more_lnd0v_207`,d=`_media_lnd0v_215`,f=`_recommend_lnd0v_237`,p=`_response_lnd0v_277`,m=`_responseTitle_lnd0v_299`,h=`_responseDate_lnd0v_311`,g=`_responseBody_lnd0v_321`,_=`_footer_lnd0v_331`,v=`_helpful_lnd0v_351`,y=`_helpfulLabel_lnd0v_365`,b=`_helpfulCount_lnd0v_375`,x=`_actions_lnd0v_385`,S={card:e,header:t,who:n,author:r,meta:i,date:a,ratingRow:o,title:s,bodyWrap:c,body:l,more:u,media:d,recommend:f,response:p,responseTitle:m,responseDate:h,responseBody:g,footer:_,helpful:v,helpfulLabel:y,helpfulCount:b,actions:x};exports.actions=x,exports.author=r,exports.body=l,exports.bodyWrap=c,exports.card=e,exports.date=a,exports.default=S,exports.footer=_,exports.header=t,exports.helpful=v,exports.helpfulCount=b,exports.helpfulLabel=y,exports.media=d,exports.meta=i,exports.more=u,exports.ratingRow=o,exports.recommend=f,exports.response=p,exports.responseBody=g,exports.responseDate=h,exports.responseTitle=m,exports.title=s,exports.who=n;
@@ -0,0 +1,26 @@
1
+ // src/components/data-display/ReviewCard/ReviewCard.module.css
2
+ var e = "_card_lnd0v_23", t = "_header_lnd0v_51", n = "_who_lnd0v_65", r = "_author_lnd0v_79", i = "_meta_lnd0v_95", a = "_date_lnd0v_97", o = "_ratingRow_lnd0v_119", s = "_title_lnd0v_133", c = "_bodyWrap_lnd0v_151", l = "_body_lnd0v_151", u = "_more_lnd0v_207", d = "_media_lnd0v_215", f = "_recommend_lnd0v_237", p = "_response_lnd0v_277", m = "_responseTitle_lnd0v_299", h = "_responseDate_lnd0v_311", g = "_responseBody_lnd0v_321", _ = "_footer_lnd0v_331", v = "_helpful_lnd0v_351", y = "_helpfulLabel_lnd0v_365", b = "_helpfulCount_lnd0v_375", x = "_actions_lnd0v_385", S = {
3
+ card: e,
4
+ header: t,
5
+ who: n,
6
+ author: r,
7
+ meta: i,
8
+ date: a,
9
+ ratingRow: o,
10
+ title: s,
11
+ bodyWrap: c,
12
+ body: l,
13
+ more: u,
14
+ media: d,
15
+ recommend: f,
16
+ response: p,
17
+ responseTitle: m,
18
+ responseDate: h,
19
+ responseBody: g,
20
+ footer: _,
21
+ helpful: v,
22
+ helpfulLabel: y,
23
+ helpfulCount: b,
24
+ actions: x
25
+ };
26
+ export { x as actions, r as author, l as body, c as bodyWrap, e as card, a as date, S as default, _ as footer, t as header, v as helpful, b as helpfulCount, y as helpfulLabel, d as media, i as meta, u as more, o as ratingRow, f as recommend, p as response, g as responseBody, h as responseDate, m as responseTitle, s as title, n as who };
@@ -0,0 +1 @@
1
+ export * from './ReviewCard';
@@ -0,0 +1 @@
1
+ "use client";const e=require("../../../hooks/useControllableState.cjs.js"),t=require("../../../hooks/useFormReset.cjs.js"),n=require("../../../utils/cx.cjs.js"),r=require("../../primitives/Icon/icons.cjs.js"),i=require("../../utilities/LocaleProvider/LocaleProvider.cjs.js"),a=require("../../utilities/VisuallyHidden/VisuallyHidden.cjs.js"),o=require("../Field/FieldContext.cjs.js"),s=require("../Rating/Rating.cjs.js"),c=require("./RatingScale.module.css.cjs.js");let l=require("react"),u=require("react/jsx-runtime");var ee={sm:c.default.sm,md:c.default.md,lg:c.default.lg},te={faces:c.default.faces,numbers:c.default.numbers,thumbs:c.default.thumbs},d=[(0,u.jsx)(r.FaceVerySadIcon,{},`1`),(0,u.jsx)(r.FaceSadIcon,{},`2`),(0,u.jsx)(r.FaceNeutralIcon,{},`3`),(0,u.jsx)(r.FaceHappyIcon,{},`4`),(0,u.jsx)(r.FaceVeryHappyIcon,{},`5`)],ne=[`danger`,`warning`,`neutral`,`info`,`success`],f=(...e)=>e.filter(Boolean).join(` `)||void 0;function p(e,t,{min:n=1,max:i=5,locale:a}={}){if(e===`faces`)return t.ratingScale.faces.map((e,t)=>({value:t+1,label:e,icon:d[t]}));if(e===`thumbs`)return[{value:1,label:t.ratingScale.thumbsUp,icon:(0,u.jsx)(r.ThumbsUpIcon,{})},{value:0,label:t.ratingScale.thumbsDown,icon:(0,u.jsx)(r.ThumbsDownIcon,{})}];let o=Math.round(Math.min(n,i)),c=Math.round(Math.max(n,i)),l=[];for(let e=o;e<=c;e++)l.push({value:e,label:t.rating.option(s.formatRatingValue(e,a),c),icon:s.formatRatingValue(e,a)});return l}function m({variant:r=`numbers`,value:d,defaultValue:m=null,onValueChange:re,min:h=1,max:g=5,options:_,startLabel:v,endLabel:y,showLabels:ie=!1,sentiment:ae=!1,size:oe,allowClear:b=!1,clearHint:se,disabled:x,readOnly:ce,invalid:S,required:le,name:C,getReadOnlyLabel:w,unratedLabel:T,label:E,description:D,className:ue,id:de,onKeyDown:fe,"aria-describedby":O,"aria-labelledby":k,...pe}){let{messages:A,locale:j}=i.useLocale(),M=se??A.rating.clearHint,N=w??(e=>A.ratingScale.display(e.label)),P=T??A.rating.unrated,F=o.useFieldContext(),I=(0,l.useId)(),L=`${I}-label`,R=`${I}-description`,z=`${I}-anchors`,B=`${I}-clear`,V=F!==null,H=!V&&E!=null,U=D!=null,W=v!=null||y!=null,G=o.useFieldControl({id:de,invalid:S,required:le,disabled:x,readOnly:ce,size:oe,"aria-describedby":f(U&&R,W&&z,O)}),[K,q]=e.useControllableState({value:d,defaultValue:m,onChange:re});t.useFormReset(()=>G.id?document.getElementById(G.id):null,()=>q(m??null),d===void 0);let me=G.size??`md`,J=_??p(r,A,{min:h,max:g,locale:j}),he=C??`rating-scale-${I}`,ge=!G.disabled&&!G.readOnly,Y=b&&ge,X=K===null?void 0:J.find(e=>e.value===K),Z=F?.isGroup===!0&&k===void 0,_e=k??(V?F.labelId:H?L:void 0),ve=Z?{"aria-describedby":f(U&&R,W&&z,O)}:{role:G.readOnly?`group`:`radiogroup`,"aria-labelledby":_e,...G.ariaProps,"aria-disabled":G.disabled||void 0,"aria-required":G.required&&!G.readOnly||void 0},ye=e=>{fe?.(e),!e.defaultPrevented&&Y&&(e.key===`Delete`||e.key===`Backspace`)&&e.target instanceof HTMLInputElement&&(e.preventDefault(),q(null))},Q=e=>n.cx(c.default.option,ae&&r===`faces`&&c.default[ne[e]??`neutral`]),$=e=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`span`,{className:c.default.visual,"aria-hidden":`true`,children:e.icon??s.formatRatingValue(e.value,j)}),ie&&r!==`numbers`&&(0,u.jsx)(`span`,{className:c.default.caption,"aria-hidden":`true`,children:e.label})]});return(0,u.jsxs)(`div`,{id:G.id,...ve,...pe,"data-disabled":G.disabled||void 0,"data-invalid":G.invalid||void 0,"data-readonly":G.readOnly||void 0,className:n.cx(c.default.scale,ee[me],te[r],ue),onKeyDown:ye,children:[(H||U)&&(0,u.jsxs)(`div`,{className:c.default.header,children:[H&&(0,u.jsxs)(`span`,{id:L,className:c.default.label,children:[E,G.required&&!G.readOnly&&(0,u.jsxs)(`span`,{className:c.default.requiredMark,"aria-hidden":`true`,children:[` `,`*`]})]}),U&&(0,u.jsx)(`span`,{id:R,className:c.default.description,children:D})]}),(0,u.jsxs)(`div`,{className:c.default.body,children:[G.readOnly?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{role:`img`,"aria-label":X?N(X):P,className:c.default.options,children:J.map((e,t)=>(0,u.jsx)(`span`,{className:Q(t),"data-checked":e===X||void 0,children:$(e)},e.value))}),C!==void 0&&X&&(0,u.jsx)(`input`,{type:`hidden`,name:C,value:String(X.value)})]}):(0,u.jsx)(`div`,{className:c.default.options,children:J.map((e,t)=>{let n=e===X;return(0,u.jsxs)(`label`,{className:Q(t),"data-checked":n||void 0,children:[(0,u.jsx)(`input`,{type:`radio`,className:c.default.input,name:he,value:String(e.value),checked:n,disabled:G.disabled,required:G.required,"aria-label":e.label,"aria-describedby":Y?B:void 0,"aria-invalid":Z&&G.invalid?!0:void 0,onChange:t=>{t.target.checked&&q(e.value)},onClick:()=>{Y&&n&&q(null)}}),$(e)]},e.value)})}),W&&(0,u.jsxs)(`div`,{id:z,className:c.default.anchors,children:[(0,u.jsx)(`span`,{children:v}),(0,u.jsx)(`span`,{children:y})]})]}),Y&&(0,u.jsx)(a.VisuallyHidden,{id:B,children:M})]})}exports.RatingScale=m,exports.getRatingScaleOptions=p;
@@ -0,0 +1,106 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ import { Messages } from '../../../i18n/types';
3
+ import { Size } from '../../../types/common';
4
+ /** Look and built-in option set of a `RatingScale`. */
5
+ export type RatingScaleVariant = "faces" | "numbers" | "thumbs";
6
+ /** One option of a `RatingScale`. */
7
+ export interface RatingScaleOption {
8
+ /** The value reported by `onValueChange` and submitted with a form. */
9
+ value: number;
10
+ /** Accessible name (and the visible caption when `showLabels` is on). */
11
+ label: string;
12
+ /**
13
+ * Visual content of the option. Defaults to the variant's icon, or the
14
+ * value itself for `numbers`. Keep options distinguishable by shape or
15
+ * text, never by color alone.
16
+ */
17
+ icon?: ReactNode;
18
+ }
19
+ /**
20
+ * The built-in options of a variant. Exported so custom scales can start
21
+ * from them (e.g. relabel the faces).
22
+ */
23
+ export declare function getRatingScaleOptions(variant: RatingScaleVariant, messages: Messages, { min, max, locale }?: {
24
+ min?: number;
25
+ max?: number;
26
+ locale?: string;
27
+ }): RatingScaleOption[];
28
+ export interface RatingScaleProps extends Omit<ComponentPropsWithRef<"div">, "defaultValue" | "onChange" | "children"> {
29
+ /**
30
+ * Look and built-in options: five `faces` (very unhappy to very happy),
31
+ * `numbers` from `min` to `max` (e.g. a 0 to 10 likelihood scale), or
32
+ * `thumbs` up (`1`) and down (`0`). @default "numbers"
33
+ */
34
+ variant?: RatingScaleVariant;
35
+ /** Selected value (controlled). `null` means nothing is selected. Use with `onValueChange`. */
36
+ value?: number | null;
37
+ /** Initial value (uncontrolled). @default null */
38
+ defaultValue?: number | null;
39
+ /** Called with the selected value, or `null` when cleared. */
40
+ onValueChange?: (value: number | null) => void;
41
+ /** `numbers` only: the lowest value. @default 1 */
42
+ min?: number;
43
+ /** `numbers` only: the highest value. @default 5 */
44
+ max?: number;
45
+ /**
46
+ * Custom options, replacing the variant's built-in set (and `min` / `max`).
47
+ * The variant still sets the look.
48
+ */
49
+ options?: RatingScaleOption[];
50
+ /** Caption under the first option, e.g. "Not likely". Also read as part of the description. */
51
+ startLabel?: ReactNode;
52
+ /** Caption under the last option, e.g. "Very likely". Also read as part of the description. */
53
+ endLabel?: ReactNode;
54
+ /** Show each option's label under it (faces and thumbs). @default false */
55
+ showLabels?: boolean;
56
+ /**
57
+ * `faces` only: tint the faces from danger (lowest) to success (highest).
58
+ * The face shapes already carry the meaning; the tint is extra. @default false
59
+ */
60
+ sentiment?: boolean;
61
+ /** Option size. Falls back to a surrounding Field's size. @default "md" */
62
+ size?: Size;
63
+ /**
64
+ * Let the user remove their choice: clicking (or pressing Space on) the
65
+ * selected option again, or pressing Delete / Backspace, resets it to `null`.
66
+ */
67
+ allowClear?: boolean;
68
+ /**
69
+ * Instructions announced with each option when `allowClear` is on. Localize it here.
70
+ * @default "Press Space on the selected rating, or Delete, to clear it."
71
+ */
72
+ clearHint?: string;
73
+ /** Disables every option. Falls back to a surrounding Field's state. */
74
+ disabled?: boolean;
75
+ /**
76
+ * Show the value without allowing changes: a single `role="img"` named
77
+ * "Rated: Happy", plus a hidden input so the value still submits when `name` is set.
78
+ */
79
+ readOnly?: boolean;
80
+ /** Marks the scale invalid: danger outlines and `aria-invalid`. Falls back to a surrounding Field's state. */
81
+ invalid?: boolean;
82
+ /** A choice is required: sets native `required` on the radios. Falls back to a surrounding Field's state. */
83
+ required?: boolean;
84
+ /** Shared `name` for the native radios (used in form submission). Generated with `useId` when omitted. */
85
+ name?: string;
86
+ /** Read-only: accessible name. Localize it here. @default "Rated: Happy" */
87
+ getReadOnlyLabel?: (option: RatingScaleOption) => string;
88
+ /** Read-only with no value: accessible name. @default "Not rated" */
89
+ unratedLabel?: string;
90
+ /**
91
+ * Visible label, used when the scale stands alone. Ignored inside a
92
+ * `Field`/`Fieldset`, whose label or legend names it. Without a label,
93
+ * pass `aria-label` or `aria-labelledby`.
94
+ */
95
+ label?: ReactNode;
96
+ /** Help text under the label, linked with `aria-describedby`. */
97
+ description?: ReactNode;
98
+ }
99
+ /**
100
+ * A labeled, single-choice rating scale: faces, numbers (such as a 0 to 10
101
+ * likelihood scale), or thumbs up and down. Unlike `Rating`, each option is
102
+ * its own choice with its own name, so choosing one never fills the others.
103
+ * Built on native radios in a `role="radiogroup"`: Tab lands on the selected
104
+ * option, arrow keys move and select, and the value submits with a form.
105
+ */
106
+ export declare function RatingScale({ variant, value: valueProp, defaultValue, onValueChange, min, max, options: optionsProp, startLabel, endLabel, showLabels, sentiment, size: sizeProp, allowClear, clearHint: clearHintProp, disabled: disabledProp, readOnly: readOnlyProp, invalid: invalidProp, required: requiredProp, name, getReadOnlyLabel: getReadOnlyLabelProp, unratedLabel: unratedLabelProp, label, description, className, id: idProp, onKeyDown, "aria-describedby": ariaDescribedBy, "aria-labelledby": ariaLabelledBy, ...rest }: RatingScaleProps): import("react").JSX.Element;
@@ -0,0 +1,175 @@
1
+ "use client";
2
+ import { useControllableState as e } from "../../../hooks/useControllableState.mjs";
3
+ import { useFormReset as t } from "../../../hooks/useFormReset.mjs";
4
+ import { cx as n } from "../../../utils/cx.mjs";
5
+ import { FaceHappyIcon as r, FaceNeutralIcon as i, FaceSadIcon as a, FaceVeryHappyIcon as o, FaceVerySadIcon as s, ThumbsDownIcon as c, ThumbsUpIcon as l } from "../../primitives/Icon/icons.mjs";
6
+ import { useLocale as ee } from "../../utilities/LocaleProvider/LocaleProvider.mjs";
7
+ import { VisuallyHidden as te } from "../../utilities/VisuallyHidden/VisuallyHidden.mjs";
8
+ import { useFieldContext as ne, useFieldControl as re } from "../Field/FieldContext.mjs";
9
+ import { formatRatingValue as u } from "../Rating/Rating.mjs";
10
+ import d from "./RatingScale.module.css.mjs";
11
+ import { useId as f } from "react";
12
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
13
+ // src/components/forms/RatingScale/RatingScale.tsx
14
+ var ie = {
15
+ sm: d.sm,
16
+ md: d.md,
17
+ lg: d.lg
18
+ }, ae = {
19
+ faces: d.faces,
20
+ numbers: d.numbers,
21
+ thumbs: d.thumbs
22
+ }, g = [
23
+ /* @__PURE__ */ m(s, {}, "1"),
24
+ /* @__PURE__ */ m(a, {}, "2"),
25
+ /* @__PURE__ */ m(i, {}, "3"),
26
+ /* @__PURE__ */ m(r, {}, "4"),
27
+ /* @__PURE__ */ m(o, {}, "5")
28
+ ], oe = [
29
+ "danger",
30
+ "warning",
31
+ "neutral",
32
+ "info",
33
+ "success"
34
+ ], _ = (...e) => e.filter(Boolean).join(" ") || void 0;
35
+ function v(e, t, { min: n = 1, max: r = 5, locale: i } = {}) {
36
+ if (e === "faces") return t.ratingScale.faces.map((e, t) => ({
37
+ value: t + 1,
38
+ label: e,
39
+ icon: g[t]
40
+ }));
41
+ if (e === "thumbs") return [{
42
+ value: 1,
43
+ label: t.ratingScale.thumbsUp,
44
+ icon: /* @__PURE__ */ m(l, {})
45
+ }, {
46
+ value: 0,
47
+ label: t.ratingScale.thumbsDown,
48
+ icon: /* @__PURE__ */ m(c, {})
49
+ }];
50
+ let a = Math.round(Math.min(n, r)), o = Math.round(Math.max(n, r)), s = [];
51
+ for (let e = a; e <= o; e++) s.push({
52
+ value: e,
53
+ label: t.rating.option(u(e, i), o),
54
+ icon: u(e, i)
55
+ });
56
+ return s;
57
+ }
58
+ function y({ variant: r = "numbers", value: i, defaultValue: a = null, onValueChange: o, min: s = 1, max: c = 5, options: l, startLabel: g, endLabel: y, showLabels: se = !1, sentiment: ce = !1, size: b, allowClear: x = !1, clearHint: S, disabled: le, readOnly: ue, invalid: de, required: fe, name: C, getReadOnlyLabel: w, unratedLabel: pe, label: T, description: E, className: me, id: he, onKeyDown: ge, "aria-describedby": D, "aria-labelledby": O, ...k }) {
59
+ let { messages: A, locale: j } = ee(), M = S ?? A.rating.clearHint, N = w ?? ((e) => A.ratingScale.display(e.label)), P = pe ?? A.rating.unrated, F = ne(), I = f(), L = `${I}-label`, R = `${I}-description`, z = `${I}-anchors`, B = `${I}-clear`, V = F !== null, H = !V && T != null, U = E != null, W = g != null || y != null, G = re({
60
+ id: he,
61
+ invalid: de,
62
+ required: fe,
63
+ disabled: le,
64
+ readOnly: ue,
65
+ size: b,
66
+ "aria-describedby": _(U && R, W && z, D)
67
+ }), [K, q] = e({
68
+ value: i,
69
+ defaultValue: a,
70
+ onChange: o
71
+ });
72
+ t(() => G.id ? document.getElementById(G.id) : null, () => q(a ?? null), i === void 0);
73
+ let _e = G.size ?? "md", J = l ?? v(r, A, {
74
+ min: s,
75
+ max: c,
76
+ locale: j
77
+ }), ve = C ?? `rating-scale-${I}`, ye = !G.disabled && !G.readOnly, Y = x && ye, X = K === null ? void 0 : J.find((e) => e.value === K), Z = F?.isGroup === !0 && O === void 0, be = O ?? (V ? F.labelId : H ? L : void 0), xe = Z ? { "aria-describedby": _(U && R, W && z, D) } : {
78
+ role: G.readOnly ? "group" : "radiogroup",
79
+ "aria-labelledby": be,
80
+ ...G.ariaProps,
81
+ "aria-disabled": G.disabled || void 0,
82
+ "aria-required": G.required && !G.readOnly || void 0
83
+ }, Se = (e) => {
84
+ ge?.(e), !e.defaultPrevented && Y && (e.key === "Delete" || e.key === "Backspace") && e.target instanceof HTMLInputElement && (e.preventDefault(), q(null));
85
+ }, Q = (e) => n(d.option, ce && r === "faces" && d[oe[e] ?? "neutral"]), $ = (e) => /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
86
+ className: d.visual,
87
+ "aria-hidden": "true",
88
+ children: e.icon ?? u(e.value, j)
89
+ }), se && r !== "numbers" && /* @__PURE__ */ m("span", {
90
+ className: d.caption,
91
+ "aria-hidden": "true",
92
+ children: e.label
93
+ })] });
94
+ return /* @__PURE__ */ h("div", {
95
+ id: G.id,
96
+ ...xe,
97
+ ...k,
98
+ "data-disabled": G.disabled || void 0,
99
+ "data-invalid": G.invalid || void 0,
100
+ "data-readonly": G.readOnly || void 0,
101
+ className: n(d.scale, ie[_e], ae[r], me),
102
+ onKeyDown: Se,
103
+ children: [
104
+ (H || U) && /* @__PURE__ */ h("div", {
105
+ className: d.header,
106
+ children: [H && /* @__PURE__ */ h("span", {
107
+ id: L,
108
+ className: d.label,
109
+ children: [T, G.required && !G.readOnly && /* @__PURE__ */ h("span", {
110
+ className: d.requiredMark,
111
+ "aria-hidden": "true",
112
+ children: [" ", "*"]
113
+ })]
114
+ }), U && /* @__PURE__ */ m("span", {
115
+ id: R,
116
+ className: d.description,
117
+ children: E
118
+ })]
119
+ }),
120
+ /* @__PURE__ */ h("div", {
121
+ className: d.body,
122
+ children: [G.readOnly ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
123
+ role: "img",
124
+ "aria-label": X ? N(X) : P,
125
+ className: d.options,
126
+ children: J.map((e, t) => /* @__PURE__ */ m("span", {
127
+ className: Q(t),
128
+ "data-checked": e === X || void 0,
129
+ children: $(e)
130
+ }, e.value))
131
+ }), C !== void 0 && X && /* @__PURE__ */ m("input", {
132
+ type: "hidden",
133
+ name: C,
134
+ value: String(X.value)
135
+ })] }) : /* @__PURE__ */ m("div", {
136
+ className: d.options,
137
+ children: J.map((e, t) => {
138
+ let n = e === X;
139
+ return /* @__PURE__ */ h("label", {
140
+ className: Q(t),
141
+ "data-checked": n || void 0,
142
+ children: [/* @__PURE__ */ m("input", {
143
+ type: "radio",
144
+ className: d.input,
145
+ name: ve,
146
+ value: String(e.value),
147
+ checked: n,
148
+ disabled: G.disabled,
149
+ required: G.required,
150
+ "aria-label": e.label,
151
+ "aria-describedby": Y ? B : void 0,
152
+ "aria-invalid": Z && G.invalid ? !0 : void 0,
153
+ onChange: (t) => {
154
+ t.target.checked && q(e.value);
155
+ },
156
+ onClick: () => {
157
+ Y && n && q(null);
158
+ }
159
+ }), $(e)]
160
+ }, e.value);
161
+ })
162
+ }), W && /* @__PURE__ */ h("div", {
163
+ id: z,
164
+ className: d.anchors,
165
+ children: [/* @__PURE__ */ m("span", { children: g }), /* @__PURE__ */ m("span", { children: y })]
166
+ })]
167
+ }),
168
+ Y && /* @__PURE__ */ m(te, {
169
+ id: B,
170
+ children: M
171
+ })
172
+ ]
173
+ });
174
+ }
175
+ export { y as RatingScale, v as getRatingScaleOptions };
@@ -0,0 +1 @@
1
+ var e=`_sm_1e4tw_35`,t=`_md_1e4tw_45`,n=`_lg_1e4tw_55`,r=`_faces_1e4tw_71`,i=`_thumbs_1e4tw_73`,a=`_numbers_1e4tw_79`,o=`_danger_1e4tw_89`,s=`_warning_1e4tw_95`,c=`_neutral_1e4tw_101`,l=`_info_1e4tw_107`,u=`_success_1e4tw_113`,d=`_scale_1e4tw_129`,f=`_header_1e4tw_147`,p=`_label_1e4tw_159`,m=`_requiredMark_1e4tw_175`,h=`_description_1e4tw_183`,g=`_body_1e4tw_195`,_=`_options_1e4tw_209`,v=`_anchors_1e4tw_221`,y=`_option_1e4tw_209`,b=`_caption_1e4tw_299`,x=`_visual_1e4tw_309`,S=`_input_1e4tw_373`,C=`_pop_1e4tw_1`,w={sm:e,md:t,lg:n,faces:r,thumbs:i,numbers:a,danger:o,warning:s,neutral:c,info:l,success:u,scale:d,header:f,label:p,requiredMark:m,description:h,body:g,options:_,anchors:v,option:y,caption:b,visual:x,input:S,pop:C};exports.anchors=v,exports.body=g,exports.caption=b,exports.danger=o,exports.default=w,exports.description=h,exports.faces=r,exports.header=f,exports.info=l,exports.input=S,exports.label=p,exports.lg=n,exports.md=t,exports.neutral=c,exports.numbers=a,exports.option=y,exports.options=_,exports.pop=C,exports.requiredMark=m,exports.scale=d,exports.sm=e,exports.success=u,exports.thumbs=i,exports.visual=x,exports.warning=s;
@@ -0,0 +1,28 @@
1
+ // src/components/forms/RatingScale/RatingScale.module.css
2
+ var e = "_sm_1e4tw_35", t = "_md_1e4tw_45", n = "_lg_1e4tw_55", r = "_faces_1e4tw_71", i = "_thumbs_1e4tw_73", a = "_numbers_1e4tw_79", o = "_danger_1e4tw_89", s = "_warning_1e4tw_95", c = "_neutral_1e4tw_101", l = "_info_1e4tw_107", u = "_success_1e4tw_113", d = "_scale_1e4tw_129", f = "_header_1e4tw_147", p = "_label_1e4tw_159", m = "_requiredMark_1e4tw_175", h = "_description_1e4tw_183", g = "_body_1e4tw_195", _ = "_options_1e4tw_209", v = "_anchors_1e4tw_221", y = "_option_1e4tw_209", b = "_caption_1e4tw_299", x = "_visual_1e4tw_309", S = "_input_1e4tw_373", C = "_pop_1e4tw_1", w = {
3
+ sm: e,
4
+ md: t,
5
+ lg: n,
6
+ faces: r,
7
+ thumbs: i,
8
+ numbers: a,
9
+ danger: o,
10
+ warning: s,
11
+ neutral: c,
12
+ info: l,
13
+ success: u,
14
+ scale: d,
15
+ header: f,
16
+ label: p,
17
+ requiredMark: m,
18
+ description: h,
19
+ body: g,
20
+ options: _,
21
+ anchors: v,
22
+ option: y,
23
+ caption: b,
24
+ visual: x,
25
+ input: S,
26
+ pop: C
27
+ };
28
+ export { v as anchors, g as body, b as caption, o as danger, w as default, h as description, r as faces, f as header, l as info, S as input, p as label, n as lg, t as md, c as neutral, a as numbers, y as option, _ as options, C as pop, m as requiredMark, d as scale, e as sm, u as success, i as thumbs, x as visual, s as warning };
@@ -0,0 +1 @@
1
+ export * from './RatingScale';