@cellarnode/ui 0.2.0 → 0.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.
- package/README.md +238 -0
- package/dist/globe/country-coords.d.ts +29 -0
- package/dist/globe/country-coords.d.ts.map +1 -0
- package/dist/globe/country-coords.js +117 -0
- package/dist/globe/country-coords.js.map +1 -0
- package/dist/globe/globe-loading-skeleton.d.ts +10 -0
- package/dist/globe/globe-loading-skeleton.d.ts.map +1 -0
- package/dist/globe/globe-loading-skeleton.js +23 -0
- package/dist/globe/globe-loading-skeleton.js.map +1 -0
- package/dist/globe/index.d.ts +2 -0
- package/dist/globe/index.d.ts.map +1 -1
- package/dist/globe/index.js +2 -0
- package/dist/globe/index.js.map +1 -1
- package/dist/hooks/use-deferred-mount.d.ts +16 -0
- package/dist/hooks/use-deferred-mount.d.ts.map +1 -0
- package/dist/hooks/use-deferred-mount.js +32 -0
- package/dist/hooks/use-deferred-mount.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/nav/app-shell.d.ts +18 -0
- package/dist/nav/app-shell.d.ts.map +1 -0
- package/dist/nav/app-shell.js +9 -0
- package/dist/nav/app-shell.js.map +1 -0
- package/dist/nav/app-sidebar.d.ts +33 -0
- package/dist/nav/app-sidebar.d.ts.map +1 -0
- package/dist/nav/app-sidebar.js +46 -0
- package/dist/nav/app-sidebar.js.map +1 -0
- package/dist/nav/expandable-nav-item.d.ts +11 -0
- package/dist/nav/expandable-nav-item.d.ts.map +1 -0
- package/dist/nav/expandable-nav-item.js +27 -0
- package/dist/nav/expandable-nav-item.js.map +1 -0
- package/dist/nav/index.d.ts +6 -0
- package/dist/nav/index.d.ts.map +1 -0
- package/dist/nav/index.js +5 -0
- package/dist/nav/index.js.map +1 -0
- package/dist/nav/types.d.ts +40 -0
- package/dist/nav/types.d.ts.map +1 -0
- package/dist/nav/types.js +4 -0
- package/dist/nav/types.js.map +1 -0
- package/dist/offer/beverage-details.d.ts +23 -0
- package/dist/offer/beverage-details.d.ts.map +1 -0
- package/dist/offer/beverage-details.js +41 -0
- package/dist/offer/beverage-details.js.map +1 -0
- package/dist/offer/composition-list.d.ts +9 -0
- package/dist/offer/composition-list.d.ts.map +1 -0
- package/dist/offer/composition-list.js +9 -0
- package/dist/offer/composition-list.js.map +1 -0
- package/dist/offer/index.d.ts +12 -0
- package/dist/offer/index.d.ts.map +1 -1
- package/dist/offer/index.js +6 -0
- package/dist/offer/index.js.map +1 -1
- package/dist/offer/opportunity-requirements.d.ts +31 -0
- package/dist/offer/opportunity-requirements.d.ts.map +1 -0
- package/dist/offer/opportunity-requirements.js +54 -0
- package/dist/offer/opportunity-requirements.js.map +1 -0
- package/dist/offer/org-banner.d.ts +11 -0
- package/dist/offer/org-banner.d.ts.map +1 -0
- package/dist/offer/org-banner.js +19 -0
- package/dist/offer/org-banner.js.map +1 -0
- package/dist/offer/reviews-summary.d.ts +19 -0
- package/dist/offer/reviews-summary.d.ts.map +1 -0
- package/dist/offer/reviews-summary.js +17 -0
- package/dist/offer/reviews-summary.js.map +1 -0
- package/dist/offer/sensory-profile.d.ts +11 -0
- package/dist/offer/sensory-profile.d.ts.map +1 -0
- package/dist/offer/sensory-profile.js +28 -0
- package/dist/offer/sensory-profile.js.map +1 -0
- package/package.json +11 -2
- package/src/theme/tokens.css +6 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensory-profile.d.ts","sourceRoot":"","sources":["../../src/offer/sensory-profile.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7E,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,cAAc,CAAC,EAC7B,cAAc,EACd,WAAW,EACX,WAAW,EACX,SAAS,GACV,EAAE,mBAAmB,kDAsCrB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../lib/utils";
|
|
3
|
+
function capitalize(s) {
|
|
4
|
+
return s.charAt(0).toUpperCase() + s.slice(1).replace(/[_-]/g, " ");
|
|
5
|
+
}
|
|
6
|
+
function hasValues(fields) {
|
|
7
|
+
if (!fields)
|
|
8
|
+
return false;
|
|
9
|
+
return Object.values(fields).some((v) => v != null && v.trim() !== "");
|
|
10
|
+
}
|
|
11
|
+
export function SensoryProfile({ sensoryDetails, stageLabels, fieldLabels, className, }) {
|
|
12
|
+
if (!sensoryDetails)
|
|
13
|
+
return null;
|
|
14
|
+
const stages = Object.entries(sensoryDetails).filter(([, fields]) => hasValues(fields));
|
|
15
|
+
if (stages.length === 0)
|
|
16
|
+
return null;
|
|
17
|
+
return (_jsx("div", { className: cn("grid gap-5", className), children: stages.map(([stageKey, fields]) => {
|
|
18
|
+
if (!fields)
|
|
19
|
+
return null;
|
|
20
|
+
const stageLabel = stageLabels?.[stageKey] ?? capitalize(stageKey);
|
|
21
|
+
const stageFieldLabels = fieldLabels?.[stageKey];
|
|
22
|
+
const entries = Object.entries(fields).filter(([, v]) => v != null && v.trim() !== "");
|
|
23
|
+
if (entries.length === 0)
|
|
24
|
+
return null;
|
|
25
|
+
return (_jsxs("div", { className: "grid gap-2", children: [_jsx("h4", { className: "text-sm font-semibold text-foreground", children: stageLabel }), _jsx("div", { className: "grid grid-cols-2 gap-x-4 gap-y-2 sm:grid-cols-3", children: entries.map(([fieldKey, value]) => (_jsxs("div", { className: "grid gap-0.5", children: [_jsx("span", { className: "text-xs text-muted-foreground", children: stageFieldLabels?.[fieldKey] ?? capitalize(fieldKey) }), _jsx("span", { className: "text-sm text-foreground", children: value })] }, fieldKey))) })] }, stageKey));
|
|
26
|
+
}) }));
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=sensory-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sensory-profile.js","sourceRoot":"","sources":["../../src/offer/sensory-profile.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAYlC,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,SAAS,CAAC,MAAwD;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAC7B,cAAc,EACd,WAAW,EACX,WAAW,EACX,SAAS,GACW;IACpB,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IAEjC,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAExF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,I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cellarnode/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Shared UI components, theme tokens, and chat/offer primitives for CellarNode dashboards.",
|
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
"./animated-list": {
|
|
47
47
|
"types": "./dist/components/animated-list.d.ts",
|
|
48
48
|
"default": "./dist/components/animated-list.js"
|
|
49
|
+
},
|
|
50
|
+
"./nav": {
|
|
51
|
+
"types": "./dist/nav/index.d.ts",
|
|
52
|
+
"default": "./dist/nav/index.js"
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
"files": [
|
|
@@ -61,10 +65,10 @@
|
|
|
61
65
|
"build-storybook": "storybook build"
|
|
62
66
|
},
|
|
63
67
|
"peerDependencies": {
|
|
68
|
+
"@cellarnode/beverage-utils": ">=0.3.0",
|
|
64
69
|
"@dnd-kit/dom": "^0.3.2",
|
|
65
70
|
"@dnd-kit/react": "^0.3.2",
|
|
66
71
|
"@tanstack/react-query": "^5.0.0",
|
|
67
|
-
"@cellarnode/beverage-utils": ">=0.3.0",
|
|
68
72
|
"i18n-iso-countries": ">=7.0.0",
|
|
69
73
|
"motion": "^12.0.0",
|
|
70
74
|
"react": "^19.0.0",
|
|
@@ -139,6 +143,8 @@
|
|
|
139
143
|
"devDependencies": {
|
|
140
144
|
"@dnd-kit/dom": "^0.3.2",
|
|
141
145
|
"@dnd-kit/react": "^0.3.2",
|
|
146
|
+
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
147
|
+
"@eslint/js": "^10.0.1",
|
|
142
148
|
"@storybook/addon-a11y": "^10.3.3",
|
|
143
149
|
"@storybook/addon-docs": "^10.3.3",
|
|
144
150
|
"@storybook/addon-mcp": "^0.4.2",
|
|
@@ -155,6 +161,8 @@
|
|
|
155
161
|
"@types/topojson-specification": "^1.0.5",
|
|
156
162
|
"@vitest/browser-playwright": "^4.1.2",
|
|
157
163
|
"@vitest/coverage-v8": "^4.1.2",
|
|
164
|
+
"eslint": "^10.1.0",
|
|
165
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
158
166
|
"i18n-iso-countries": "^7.14.0",
|
|
159
167
|
"motion": "^12.38.0",
|
|
160
168
|
"playwright": "^1.58.2",
|
|
@@ -164,6 +172,7 @@
|
|
|
164
172
|
"three": "^0.182.0",
|
|
165
173
|
"topojson-client": "^3.1.0",
|
|
166
174
|
"typescript": "^5.9.3",
|
|
175
|
+
"typescript-eslint": "^8.57.2",
|
|
167
176
|
"vitest": "^4.1.2",
|
|
168
177
|
"world-atlas": "^2.0.2"
|
|
169
178
|
}
|