@veevarts/design-system 2.0.0-alpha.6 → 2.0.0-alpha.61
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 +82 -0
- package/dist/assistant.cjs +1 -0
- package/dist/assistant.d.ts +10 -0
- package/dist/assistant.js +790 -0
- package/dist/components/DatePicker/DatePicker.d.ts +9 -2
- package/dist/components/DatePicker/defaults.d.ts +28 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/Drawer/Drawer.d.ts +17 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Modal/CloseButton.d.ts +18 -0
- package/dist/components/Modal/Modal.d.ts +15 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/Modal/useLabelledCloseButton.d.ts +13 -0
- package/dist/components/Select/Select.d.ts +10 -0
- package/dist/components/Skeleton/Skeleton.d.ts +37 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +7 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/index.d.ts +9 -1
- package/dist/hasContent-BCRxiry-.js +1200 -0
- package/dist/hasContent-JfCtoDIu.cjs +1 -0
- package/dist/index.cjs +9 -9
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11013 -7145
- package/dist/patterns/ActivityTimeline/ActivityTimeline.d.ts +3 -0
- package/dist/patterns/ActivityTimeline/index.d.ts +2 -0
- package/dist/patterns/ActivityTimeline/styles.d.ts +15 -0
- package/dist/patterns/ActivityTimeline/types.d.ts +15 -0
- package/dist/patterns/AdminTable/AdminTable.d.ts +1 -0
- package/dist/patterns/AdminTable/styles.d.ts +8 -1
- package/dist/patterns/AdminTextField/AdminTextField.d.ts +4 -44
- package/dist/patterns/AdminTextField/index.d.ts +2 -2
- package/dist/patterns/AdminTextField/styles.d.ts +29 -0
- package/dist/patterns/AdminTextField/types.d.ts +78 -0
- package/dist/patterns/AdminToolbar/AdminToolbar.d.ts +13 -2
- package/dist/patterns/AdminToolbar/index.d.ts +1 -0
- package/dist/patterns/AdminToolbar/styles.d.ts +49 -0
- package/dist/patterns/AdminToolbar/types.d.ts +2 -0
- package/dist/patterns/AmountList/AmountList.d.ts +3 -0
- package/dist/patterns/AmountList/index.d.ts +2 -0
- package/dist/patterns/AmountList/styles.d.ts +23 -0
- package/dist/patterns/AmountList/types.d.ts +26 -0
- package/dist/patterns/AssistantActivity/AssistantActivity.d.ts +15 -0
- package/dist/patterns/AssistantActivity/formatAssistantDuration.d.ts +10 -0
- package/dist/patterns/AssistantActivity/index.d.ts +3 -0
- package/dist/patterns/AssistantActivity/styles.d.ts +31 -0
- package/dist/patterns/AssistantActivity/types.d.ts +42 -0
- package/dist/patterns/AssistantComposer/AssistantComposer.d.ts +15 -0
- package/dist/patterns/AssistantComposer/index.d.ts +2 -0
- package/dist/patterns/AssistantComposer/styles.d.ts +33 -0
- package/dist/patterns/AssistantComposer/types.d.ts +62 -0
- package/dist/patterns/AssistantMessage/AssistantMessage.d.ts +17 -0
- package/dist/patterns/AssistantMessage/index.d.ts +2 -0
- package/dist/patterns/AssistantMessage/styles.d.ts +45 -0
- package/dist/patterns/AssistantMessage/types.d.ts +84 -0
- package/dist/patterns/AssistantNotice/AssistantNotice.d.ts +18 -0
- package/dist/patterns/AssistantNotice/index.d.ts +2 -0
- package/dist/patterns/AssistantNotice/styles.d.ts +49 -0
- package/dist/patterns/AssistantNotice/types.d.ts +58 -0
- package/dist/patterns/CardList/CardList.d.ts +3 -0
- package/dist/patterns/CardList/index.d.ts +2 -0
- package/dist/patterns/CardList/styles.d.ts +20 -0
- package/dist/patterns/CardList/types.d.ts +20 -0
- package/dist/patterns/CardStack/CardStack.d.ts +7 -0
- package/dist/patterns/CardStack/index.d.ts +2 -0
- package/dist/patterns/CardStack/styles.d.ts +2 -0
- package/dist/patterns/CashTenderForm/types.d.ts +6 -0
- package/dist/patterns/CellText/CellText.d.ts +16 -0
- package/dist/patterns/CellText/index.d.ts +2 -0
- package/dist/patterns/CellText/styles.d.ts +7 -0
- package/dist/patterns/DiscardGuard/DiscardGuard.d.ts +23 -0
- package/dist/patterns/DiscardGuard/context.d.ts +25 -0
- package/dist/patterns/DiscardGuard/index.d.ts +6 -0
- package/dist/patterns/DiscardGuard/useDiscardGuard.d.ts +38 -0
- package/dist/patterns/DonationAmounts/index.d.ts +1 -1
- package/dist/patterns/DonationAmounts/styles.d.ts +51 -0
- package/dist/patterns/DonationAmounts/types.d.ts +79 -1
- package/dist/patterns/DonationAmounts/utils/currency.d.ts +23 -3
- package/dist/patterns/EntityRow/EntityList.d.ts +15 -0
- package/dist/patterns/EntityRow/EntityRow.d.ts +3 -0
- package/dist/patterns/EntityRow/context.d.ts +2 -0
- package/dist/patterns/EntityRow/icons.d.ts +3 -0
- package/dist/patterns/EntityRow/index.d.ts +3 -0
- package/dist/patterns/EntityRow/initials.d.ts +6 -0
- package/dist/patterns/EntityRow/styles.d.ts +74 -0
- package/dist/patterns/EntityRow/types.d.ts +125 -0
- package/dist/patterns/ExpandableTable/ExpandableTable.d.ts +6 -0
- package/dist/patterns/ExpandableTable/index.d.ts +2 -0
- package/dist/patterns/ExpandableTable/styles.d.ts +43 -0
- package/dist/patterns/ExpandableTable/types.d.ts +99 -0
- package/dist/patterns/FeedbackState/FeedbackState.d.ts +1 -1
- package/dist/patterns/FeedbackState/type.d.ts +11 -1
- package/dist/patterns/FilterSelect/FilterSelect.d.ts +3 -0
- package/dist/patterns/FilterSelect/FilterSelectGroup.d.ts +3 -0
- package/dist/patterns/FilterSelect/index.d.ts +3 -0
- package/dist/patterns/FilterSelect/styles.d.ts +17 -0
- package/dist/patterns/FilterSelect/types.d.ts +19 -0
- package/dist/patterns/InlineConfirm/InlineConfirm.d.ts +38 -0
- package/dist/patterns/InlineConfirm/index.d.ts +2 -0
- package/dist/patterns/InlineConfirm/styles.d.ts +16 -0
- package/dist/patterns/InstallmentFundAssignment/InstallmentFundAssignment.d.ts +1 -1
- package/dist/patterns/InstallmentFundAssignment/types.d.ts +3 -0
- package/dist/patterns/InstallmentSchedule/InstallmentSchedule.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/InstallmentTable.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/index.d.ts +1 -1
- package/dist/patterns/InstallmentSchedule/types.d.ts +62 -3
- package/dist/patterns/InstallmentSchedule/utils.d.ts +33 -0
- package/dist/patterns/KeyValueChip/KeyValueChip.d.ts +1 -0
- package/dist/patterns/KeyValueRows/KeyValueRows.d.ts +13 -0
- package/dist/patterns/KeyValueRows/index.d.ts +2 -0
- package/dist/patterns/KeyValueRows/styles.d.ts +8 -0
- package/dist/patterns/LineItemRows/LineItemRows.d.ts +17 -0
- package/dist/patterns/LineItemRows/index.d.ts +2 -0
- package/dist/patterns/LineItemRows/styles.d.ts +13 -0
- package/dist/patterns/ListPanel/ListPanel.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/LoadMoreFooter.d.ts +3 -0
- package/dist/patterns/LoadMoreFooter/index.d.ts +2 -0
- package/dist/patterns/LoadMoreFooter/styles.d.ts +7 -0
- package/dist/patterns/LoadMoreFooter/types.d.ts +10 -0
- package/dist/patterns/MetaCard/types.d.ts +2 -0
- package/dist/patterns/ModalPanels/ModalPanels.d.ts +35 -0
- package/dist/patterns/ModalPanels/context.d.ts +20 -0
- package/dist/patterns/ModalPanels/focus.d.ts +44 -0
- package/dist/patterns/ModalPanels/index.d.ts +6 -0
- package/dist/patterns/ModalPanels/styles.d.ts +13 -0
- package/dist/patterns/ModalPanels/useModalPanels.d.ts +30 -0
- package/dist/patterns/NeedsFixDot/NeedsFixDot.d.ts +16 -0
- package/dist/patterns/NeedsFixDot/firstNeedsFixKey.d.ts +18 -0
- package/dist/patterns/NeedsFixDot/index.d.ts +4 -0
- package/dist/patterns/NeedsFixDot/styles.d.ts +20 -0
- package/dist/patterns/Notice/Notice.d.ts +16 -0
- package/dist/patterns/Notice/index.d.ts +2 -0
- package/dist/patterns/Notice/styles.d.ts +35 -0
- package/dist/patterns/Notice/type.d.ts +39 -0
- package/dist/patterns/OutcomeView/index.d.ts +1 -1
- package/dist/patterns/OutcomeView/types.d.ts +110 -3
- package/dist/patterns/PageHeader/PageHeader.d.ts +1 -0
- package/dist/patterns/PaginationSummary/PaginationSummary.d.ts +12 -0
- package/dist/patterns/PaginationSummary/index.d.ts +1 -1
- package/dist/patterns/PaymentSubAmountInput/PaymentSubAmountInput.d.ts +2 -0
- package/dist/patterns/PillTabs/PillTabs.d.ts +3 -0
- package/dist/patterns/PillTabs/ids.d.ts +9 -0
- package/dist/patterns/PillTabs/index.d.ts +3 -0
- package/dist/patterns/PillTabs/styles.d.ts +20 -0
- package/dist/patterns/PillTabs/types.d.ts +21 -0
- package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/type.d.ts +1 -1
- package/dist/patterns/{EventDetails → Programs/EventDetails}/EventDetails.d.ts +3 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/OfferCard.d.ts +1 -1
- package/dist/patterns/{OfferCard → Programs/OfferCard}/types.d.ts +7 -0
- package/dist/patterns/Programs/ProgramListItem/ProgramListItem.d.ts +17 -0
- package/dist/patterns/Programs/ProgramListItem/index.d.ts +2 -0
- package/dist/patterns/Programs/index.d.ts +5 -0
- package/dist/patterns/ReasonSelect/types.d.ts +1 -0
- package/dist/patterns/RecordCard/RecordCard.d.ts +3 -0
- package/dist/patterns/RecordCard/index.d.ts +2 -0
- package/dist/patterns/RecordCard/styles.d.ts +16 -0
- package/dist/patterns/RecordCard/types.d.ts +22 -0
- package/dist/patterns/RecordHeader/RecordHeader.d.ts +3 -0
- package/dist/patterns/RecordHeader/index.d.ts +2 -0
- package/dist/patterns/RecordHeader/styles.d.ts +43 -0
- package/dist/patterns/RecordHeader/types.d.ts +30 -0
- package/dist/patterns/RecordLayout/RecordLayout.d.ts +3 -0
- package/dist/patterns/RecordLayout/index.d.ts +2 -0
- package/dist/patterns/RecordLayout/styles.d.ts +8 -0
- package/dist/patterns/RecordLayout/types.d.ts +6 -0
- package/dist/patterns/RecordTotals/RecordTotals.d.ts +19 -0
- package/dist/patterns/RecordTotals/index.d.ts +2 -0
- package/dist/patterns/RecordTotals/styles.d.ts +19 -0
- package/dist/patterns/RefundMethodCards/RefundMethodCards.d.ts +4 -0
- package/dist/patterns/RefundMethodCards/index.d.ts +2 -0
- package/dist/patterns/RefundMethodCards/styles.d.ts +59 -0
- package/dist/patterns/RefundMethodCards/types.d.ts +72 -0
- package/dist/patterns/RefundProgressList/RefundProgressList.d.ts +4 -0
- package/dist/patterns/RefundProgressList/index.d.ts +2 -0
- package/dist/patterns/RefundProgressList/styles.d.ts +44 -0
- package/dist/patterns/RefundProgressList/types.d.ts +37 -0
- package/dist/patterns/RelatedRecordList/RelatedRecordList.d.ts +3 -0
- package/dist/patterns/RelatedRecordList/index.d.ts +2 -0
- package/dist/patterns/RelatedRecordList/styles.d.ts +19 -0
- package/dist/patterns/RelatedRecordList/types.d.ts +17 -0
- package/dist/patterns/ScrollToLatest/ScrollToLatest.d.ts +18 -0
- package/dist/patterns/ScrollToLatest/index.d.ts +2 -0
- package/dist/patterns/ScrollToLatest/styles.d.ts +11 -0
- package/dist/patterns/ScrollToLatest/types.d.ts +36 -0
- package/dist/patterns/SessionExpiredCard/SessionExpiredCard.d.ts +14 -0
- package/dist/patterns/SessionExpiredCard/index.d.ts +2 -0
- package/dist/patterns/SessionExpiredCard/type.d.ts +6 -0
- package/dist/patterns/SplitPaymentSummary/index.d.ts +1 -1
- package/dist/patterns/SplitPaymentSummary/types.d.ts +18 -0
- package/dist/patterns/StatTiles/StatTiles.d.ts +3 -0
- package/dist/patterns/StatTiles/index.d.ts +2 -0
- package/dist/patterns/StatTiles/styles.d.ts +8 -0
- package/dist/patterns/StatTiles/types.d.ts +12 -0
- package/dist/patterns/StatusChip/StatusChip.d.ts +3 -3
- package/dist/patterns/StepProgress/StepProgress.d.ts +4 -0
- package/dist/patterns/StepProgress/index.d.ts +2 -0
- package/dist/patterns/StepProgress/styles.d.ts +29 -0
- package/dist/patterns/StepProgress/types.d.ts +43 -0
- package/dist/patterns/Summary/components/ActionBar.d.ts +2 -0
- package/dist/patterns/Summary/components/GrandTotalRow.d.ts +1 -0
- package/dist/patterns/Summary/components/ItemRow.d.ts +1 -0
- package/dist/patterns/Summary/components/SummaryBody.d.ts +4 -1
- package/dist/patterns/Summary/components/TotalsLineRow.d.ts +3 -2
- package/dist/patterns/Summary/types.d.ts +51 -9
- package/dist/patterns/TableSkeleton/TableSkeleton.d.ts +1 -0
- package/dist/patterns/TileSelect/TileSelect.d.ts +2 -37
- package/dist/patterns/TileSelect/index.d.ts +1 -1
- package/dist/patterns/TileSelect/styles.d.ts +56 -0
- package/dist/patterns/TileSelect/types.d.ts +140 -0
- package/dist/patterns/TimeField/TimeField.d.ts +6 -0
- package/dist/patterns/TimeField/index.d.ts +3 -0
- package/dist/patterns/TimeField/time.d.ts +40 -0
- package/dist/patterns/TimeField/types.d.ts +77 -0
- package/dist/patterns/ToolbarButton/ToolbarButton.d.ts +2 -0
- package/dist/patterns/UnderlineTabs/UnderlineTabs.d.ts +40 -1
- package/dist/patterns/UnderlineTabs/index.d.ts +1 -1
- package/dist/patterns/UnderlineTabs/styles.d.ts +21 -0
- package/dist/patterns/VerticalSteps/StepPager.d.ts +6 -0
- package/dist/patterns/VerticalSteps/StepsReadiness.d.ts +15 -0
- package/dist/patterns/VerticalSteps/VerticalSteps.d.ts +6 -0
- package/dist/patterns/VerticalSteps/index.d.ts +4 -0
- package/dist/patterns/VerticalSteps/styles.d.ts +54 -0
- package/dist/patterns/VerticalSteps/types.d.ts +100 -0
- package/dist/patterns/WizardShell/index.d.ts +1 -1
- package/dist/patterns/WizardShell/types.d.ts +9 -1
- package/dist/patterns/grid-columns.d.ts +1 -1
- package/dist/patterns/index.d.ts +79 -19
- package/dist/patterns/shared/hasContent.d.ts +2 -0
- package/dist/patterns/shared/index.d.ts +1 -0
- package/dist/patterns/shared/motion.d.ts +6 -0
- package/dist/patterns/shared/recordTone.d.ts +9 -0
- package/dist/patterns/shared/rem.d.ts +4 -0
- package/dist/patterns/shared/useContainerWidth.d.ts +6 -0
- package/dist/patterns/shared/useDecimalDraft.d.ts +33 -0
- package/dist/patterns/shared/usePrefillEdits.d.ts +7 -0
- package/dist/providers/DensityProvider.d.ts +7 -0
- package/dist/providers/HeroUIProvider.d.ts +20 -1
- package/dist/providers/ToastProvider.d.ts +21 -0
- package/dist/providers/close-label-context.d.ts +18 -0
- package/dist/providers/density.d.ts +17 -0
- package/dist/providers/index.d.ts +6 -0
- package/dist/tailwind/index.cjs +107 -5
- package/dist/tailwind/index.d.ts +61 -0
- package/dist/tailwind/index.mjs +104 -5
- package/dist/test/ReducedMotion.d.ts +4 -0
- package/dist/test/RootFontSize.d.ts +5 -0
- package/dist/test/backdrop.d.ts +12 -0
- package/dist/test/container-width.d.ts +14 -0
- package/dist/test/contrast.d.ts +1 -0
- package/dist/test/px-class-names.d.ts +1 -0
- package/dist/test/px-classes.d.ts +3 -0
- package/dist/test/reducedMotionCss.d.ts +40 -0
- package/dist/test/root-font-size.d.ts +8 -0
- package/dist/tokens/assistant-surface.d.ts +66 -0
- package/dist/tokens/index.d.ts +2 -0
- package/dist/tokens/pos-surface.d.ts +23 -4
- package/package.json +22 -3
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/CatalogItemCard.d.ts +0 -0
- /package/dist/patterns/{CatalogItemCard → Programs/CatalogItemCard}/index.d.ts +0 -0
- /package/dist/patterns/{EventDetails → Programs/EventDetails}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/CustomQuantitySelectorExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithEurosCurrencyExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/ListWithoutAnimationExample.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/examples/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/animations.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/currency.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/index.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/utils/offers.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardEmpty.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardError.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardList.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/OfferCardSkeleton.d.ts +0 -0
- /package/dist/patterns/{OfferCard → Programs/OfferCard}/variants/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/SessionTimeline.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/index.d.ts +0 -0
- /package/dist/patterns/{SessionTimeline → Programs/SessionTimeline}/type.d.ts +0 -0
package/dist/tailwind/index.cjs
CHANGED
|
@@ -23,6 +23,9 @@ __export(index_exports, {
|
|
|
23
23
|
adminSurfaceCss: () => adminSurfaceCss,
|
|
24
24
|
adminSurfaceTailwindColors: () => adminSurfaceTailwindColors,
|
|
25
25
|
adminSurfaceTokens: () => adminSurfaceTokens,
|
|
26
|
+
assistantSurfacePlugin: () => assistantSurfacePlugin,
|
|
27
|
+
assistantSurfaceTailwindColors: () => assistantSurfaceTailwindColors,
|
|
28
|
+
assistantSurfaceTokens: () => assistantSurfaceTokens,
|
|
26
29
|
colors: () => colors,
|
|
27
30
|
createHeroUIConfig: () => createHeroUIConfig,
|
|
28
31
|
deepMerge: () => deepMerge,
|
|
@@ -258,12 +261,12 @@ function adminSurfaceCss({
|
|
|
258
261
|
scope = ".acct",
|
|
259
262
|
fontFamily = "'NeueMontreal', system-ui, sans-serif"
|
|
260
263
|
} = {}) {
|
|
261
|
-
const
|
|
264
|
+
const declarations2 = Object.entries(adminSurfaceTokens).map(([name, value]) => ` ${name}: ${value};`).join("\n");
|
|
262
265
|
const typography2 = fontFamily ? `
|
|
263
266
|
font-family: ${fontFamily};
|
|
264
267
|
color: var(--ink);` : "";
|
|
265
268
|
return `${scope} {
|
|
266
|
-
${
|
|
269
|
+
${declarations2}${typography2}
|
|
267
270
|
}
|
|
268
271
|
`;
|
|
269
272
|
}
|
|
@@ -274,6 +277,17 @@ var posSurfaceTokens = {
|
|
|
274
277
|
line: "#E7E7E9",
|
|
275
278
|
/** `--line2`: the lighter hairline under list rows and above the role bar. */
|
|
276
279
|
"line-2": "#F1F1F3",
|
|
280
|
+
hair: "#F0F0F1",
|
|
281
|
+
page: "#FBFBFB",
|
|
282
|
+
field: "#E5E5E5",
|
|
283
|
+
/** A hairline under the pointer (`default-300`). */
|
|
284
|
+
"line-strong": "#D4D4D8",
|
|
285
|
+
/** `--ink`: body text (`default-900`). */
|
|
286
|
+
ink: "#18181B",
|
|
287
|
+
/** `--muted`: secondary text and eyebrows, 4.83:1 on white (`default-500`). */
|
|
288
|
+
muted: "#71717A",
|
|
289
|
+
/** Placeholder text (`default-400`). Never for content: 2.56:1 on white. */
|
|
290
|
+
faint: "#A1A1AA",
|
|
277
291
|
/** `--okb` / `--okf` */
|
|
278
292
|
"ok-fill": "#EAF3DE",
|
|
279
293
|
ok: "#3B6D11",
|
|
@@ -288,11 +302,79 @@ var posSurfaceTokens = {
|
|
|
288
302
|
/** `--ib` / `--if` */
|
|
289
303
|
"info-fill": "#EAF1FC",
|
|
290
304
|
info: "#1D4FA8",
|
|
305
|
+
"violet-fill": "#F1ECFB",
|
|
306
|
+
violet: "#6D28D9",
|
|
307
|
+
"neutral-fill": "#F4F4F5",
|
|
308
|
+
neutral: "#52525B",
|
|
291
309
|
/** `.btn-dstr` — the fill behind an irreversible confirmation. */
|
|
292
310
|
destructive: "#A32D2D"
|
|
293
311
|
};
|
|
294
312
|
var posSurfaceTailwindColors = { ...posSurfaceTokens };
|
|
295
313
|
|
|
314
|
+
// src/tokens/assistant-surface.ts
|
|
315
|
+
var info = colors.palettes.info;
|
|
316
|
+
var HEROUI_CONTENT = {
|
|
317
|
+
light: { content1: "#ffffff", content2: "#f4f4f5" },
|
|
318
|
+
dark: { content1: "#18181b", content2: "#27272a" }
|
|
319
|
+
};
|
|
320
|
+
var ASSISTANT_SURFACE_TOKEN_NAMES = [
|
|
321
|
+
/** Text and icon tone that marks something as the assistant's. */
|
|
322
|
+
"accent",
|
|
323
|
+
/** Tint behind small assistant marks (an avatar disc, an info notice). */
|
|
324
|
+
"fill",
|
|
325
|
+
/** Hairline around assistant regions. */
|
|
326
|
+
"border",
|
|
327
|
+
/** Fill of the person's own turn. */
|
|
328
|
+
"user-bubble",
|
|
329
|
+
/** Fill of the assistant's turn, where an app draws it as a bubble. */
|
|
330
|
+
"assistant-bubble",
|
|
331
|
+
/** Focus ring inside assistant surfaces. */
|
|
332
|
+
"focus"
|
|
333
|
+
];
|
|
334
|
+
var assistantSurfaceTokens = {
|
|
335
|
+
light: {
|
|
336
|
+
accent: info[600],
|
|
337
|
+
fill: info[100],
|
|
338
|
+
border: info[200],
|
|
339
|
+
"user-bubble": HEROUI_CONTENT.light.content2,
|
|
340
|
+
"assistant-bubble": HEROUI_CONTENT.light.content1,
|
|
341
|
+
focus: info[500]
|
|
342
|
+
},
|
|
343
|
+
dark: {
|
|
344
|
+
accent: info[300],
|
|
345
|
+
fill: info[900],
|
|
346
|
+
border: info[800],
|
|
347
|
+
"user-bubble": HEROUI_CONTENT.dark.content2,
|
|
348
|
+
"assistant-bubble": HEROUI_CONTENT.dark.content1,
|
|
349
|
+
focus: info[400]
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
function hexToChannels(hex) {
|
|
353
|
+
if (!/^#[0-9a-f]{6}$/i.test(hex)) throw new Error(`bad hex: ${hex}`);
|
|
354
|
+
return [1, 3, 5].map((start) => parseInt(hex.slice(start, start + 2), 16)).join(" ");
|
|
355
|
+
}
|
|
356
|
+
var assistantSurfaceVar = (name) => `--ai-${name}`;
|
|
357
|
+
var declarations = (theme) => Object.fromEntries(
|
|
358
|
+
ASSISTANT_SURFACE_TOKEN_NAMES.map((name) => [
|
|
359
|
+
assistantSurfaceVar(name),
|
|
360
|
+
hexToChannels(assistantSurfaceTokens[theme][name])
|
|
361
|
+
])
|
|
362
|
+
);
|
|
363
|
+
var ASSISTANT_SURFACE_SELECTORS = {
|
|
364
|
+
light: ':root, .light, [data-theme="light"]',
|
|
365
|
+
dark: ".dark"
|
|
366
|
+
};
|
|
367
|
+
var assistantSurfaceBase = {
|
|
368
|
+
[ASSISTANT_SURFACE_SELECTORS.light]: declarations("light"),
|
|
369
|
+
[ASSISTANT_SURFACE_SELECTORS.dark]: declarations("dark")
|
|
370
|
+
};
|
|
371
|
+
var assistantSurfaceTailwindColors = Object.fromEntries(
|
|
372
|
+
ASSISTANT_SURFACE_TOKEN_NAMES.map((name) => [
|
|
373
|
+
name,
|
|
374
|
+
`rgb(var(${assistantSurfaceVar(name)}, ${hexToChannels(assistantSurfaceTokens.light[name])}) / <alpha-value>)`
|
|
375
|
+
])
|
|
376
|
+
);
|
|
377
|
+
|
|
296
378
|
// src/tailwind/index.ts
|
|
297
379
|
var tailwindTheme = {
|
|
298
380
|
colors: {
|
|
@@ -308,13 +390,26 @@ var tailwindTheme = {
|
|
|
308
390
|
// `danger`/`info`/`warn` do not shadow the semantic palettes, and fed
|
|
309
391
|
// from the token object so utility and token cannot disagree.
|
|
310
392
|
// See src/tokens/pos-surface.ts.
|
|
311
|
-
pos: posSurfaceTailwindColors
|
|
393
|
+
pos: posSurfaceTailwindColors,
|
|
394
|
+
// Assistant palette. Unlike `acct`/`pos` these resolve to CSS custom
|
|
395
|
+
// properties, because they have a dark value: the preset's plugin
|
|
396
|
+
// below writes the properties. See src/tokens/assistant-surface.ts.
|
|
397
|
+
ai: assistantSurfaceTailwindColors
|
|
312
398
|
},
|
|
313
399
|
fontFamily: typography.fontFamily,
|
|
314
400
|
spacing,
|
|
315
401
|
fontSize: typography.fontSize,
|
|
316
402
|
fontWeight: typography.fontWeight,
|
|
317
|
-
lineHeight: typography.lineHeight
|
|
403
|
+
lineHeight: typography.lineHeight,
|
|
404
|
+
keyframes: {
|
|
405
|
+
"record-shimmer": {
|
|
406
|
+
"0%": { backgroundPosition: "-25rem 0" },
|
|
407
|
+
"100%": { backgroundPosition: "25rem 0" }
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
animation: {
|
|
411
|
+
"record-shimmer": "record-shimmer 1.3s linear infinite"
|
|
412
|
+
}
|
|
318
413
|
};
|
|
319
414
|
function deepMerge(target, source) {
|
|
320
415
|
if (!source || typeof source !== "object") {
|
|
@@ -378,11 +473,15 @@ var veevartContent = [
|
|
|
378
473
|
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}",
|
|
379
474
|
"./node_modules/@veevarts/design-system/dist/**/*.{js,mjs,jsx,tsx}"
|
|
380
475
|
];
|
|
476
|
+
function assistantSurfacePlugin({ addBase }) {
|
|
477
|
+
addBase(assistantSurfaceBase);
|
|
478
|
+
}
|
|
381
479
|
var veevartPreset = {
|
|
382
480
|
theme: {
|
|
383
481
|
extend: tailwindTheme
|
|
384
482
|
},
|
|
385
|
-
darkMode: "class"
|
|
483
|
+
darkMode: "class",
|
|
484
|
+
plugins: [assistantSurfacePlugin]
|
|
386
485
|
};
|
|
387
486
|
var tokens = {
|
|
388
487
|
colors,
|
|
@@ -395,6 +494,9 @@ var tokens = {
|
|
|
395
494
|
adminSurfaceCss,
|
|
396
495
|
adminSurfaceTailwindColors,
|
|
397
496
|
adminSurfaceTokens,
|
|
497
|
+
assistantSurfacePlugin,
|
|
498
|
+
assistantSurfaceTailwindColors,
|
|
499
|
+
assistantSurfaceTokens,
|
|
398
500
|
colors,
|
|
399
501
|
createHeroUIConfig,
|
|
400
502
|
deepMerge,
|
package/dist/tailwind/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { typography } from '../tokens/typography';
|
|
|
3
3
|
import { spacing } from '../tokens/spacing';
|
|
4
4
|
export { colors, typography, spacing };
|
|
5
5
|
export { adminSurfaceCss, adminSurfaceTokens, adminSurfaceTailwindColors } from '../tokens/admin-surface';
|
|
6
|
+
export { assistantSurfaceTokens, assistantSurfaceTailwindColors } from '../tokens/assistant-surface';
|
|
6
7
|
export interface ColorPalette {
|
|
7
8
|
50: string;
|
|
8
9
|
100: string;
|
|
@@ -48,6 +49,7 @@ export declare const tailwindTheme: {
|
|
|
48
49
|
colors: {
|
|
49
50
|
acct: Record<string, string>;
|
|
50
51
|
pos: Record<string, string>;
|
|
52
|
+
ai: Record<"accent" | "fill" | "border" | "user-bubble" | "assistant-bubble" | "focus", string>;
|
|
51
53
|
secondary: "#000000";
|
|
52
54
|
success: "#057A54";
|
|
53
55
|
warning: "#F5A524";
|
|
@@ -120,6 +122,19 @@ export declare const tailwindTheme: {
|
|
|
120
122
|
readonly normal: "1.5";
|
|
121
123
|
readonly relaxed: "1.75";
|
|
122
124
|
};
|
|
125
|
+
keyframes: {
|
|
126
|
+
'record-shimmer': {
|
|
127
|
+
'0%': {
|
|
128
|
+
backgroundPosition: string;
|
|
129
|
+
};
|
|
130
|
+
'100%': {
|
|
131
|
+
backgroundPosition: string;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
animation: {
|
|
136
|
+
'record-shimmer': string;
|
|
137
|
+
};
|
|
123
138
|
};
|
|
124
139
|
/**
|
|
125
140
|
* Deep merge utility for objects
|
|
@@ -238,11 +253,28 @@ export declare function createHeroUIConfig(overrides?: HeroUIConfigOverrides): H
|
|
|
238
253
|
* Includes HeroUI theme and Design System components
|
|
239
254
|
*/
|
|
240
255
|
export declare const veevartContent: string[];
|
|
256
|
+
/** The slice of Tailwind's plugin API the preset's plugins use. */
|
|
257
|
+
export interface PresetPluginApi {
|
|
258
|
+
addBase: (base: Record<string, Record<string, string>>) => void;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Writes the `--ai-*` custom properties: light values on `:root`, dark values
|
|
262
|
+
* under `.dark`. The `ai-*` colours read them, so without this plugin they
|
|
263
|
+
* stay on their light fallbacks.
|
|
264
|
+
*
|
|
265
|
+
* A plain function, not `tailwindcss/plugin`, so this bundle does not pull
|
|
266
|
+
* Tailwind in. Add it to `plugins` yourself only if you extend
|
|
267
|
+
* `tokens.tailwindTheme` instead of using `veevartPreset`.
|
|
268
|
+
*/
|
|
269
|
+
export declare function assistantSurfacePlugin({ addBase }: PresetPluginApi): void;
|
|
241
270
|
/**
|
|
242
271
|
* Veevart Design System Tailwind preset
|
|
243
272
|
*
|
|
244
273
|
* Use this preset in your tailwind.config.js to get all Veevart tokens
|
|
245
274
|
* and styling defaults. Use veevartContent in your content array.
|
|
275
|
+
*
|
|
276
|
+
* Tailwind runs a preset's plugins alongside the app's own (HeroUI's, for
|
|
277
|
+
* instance), so the app keeps declaring `plugins` as before.
|
|
246
278
|
*/
|
|
247
279
|
export declare const veevartPreset: {
|
|
248
280
|
theme: {
|
|
@@ -250,6 +282,7 @@ export declare const veevartPreset: {
|
|
|
250
282
|
colors: {
|
|
251
283
|
acct: Record<string, string>;
|
|
252
284
|
pos: Record<string, string>;
|
|
285
|
+
ai: Record<"accent" | "fill" | "border" | "user-bubble" | "assistant-bubble" | "focus", string>;
|
|
253
286
|
secondary: "#000000";
|
|
254
287
|
success: "#057A54";
|
|
255
288
|
warning: "#F5A524";
|
|
@@ -322,9 +355,23 @@ export declare const veevartPreset: {
|
|
|
322
355
|
readonly normal: "1.5";
|
|
323
356
|
readonly relaxed: "1.75";
|
|
324
357
|
};
|
|
358
|
+
keyframes: {
|
|
359
|
+
'record-shimmer': {
|
|
360
|
+
'0%': {
|
|
361
|
+
backgroundPosition: string;
|
|
362
|
+
};
|
|
363
|
+
'100%': {
|
|
364
|
+
backgroundPosition: string;
|
|
365
|
+
};
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
animation: {
|
|
369
|
+
'record-shimmer': string;
|
|
370
|
+
};
|
|
325
371
|
};
|
|
326
372
|
};
|
|
327
373
|
darkMode: "class";
|
|
374
|
+
plugins: (typeof assistantSurfacePlugin)[];
|
|
328
375
|
};
|
|
329
376
|
/**
|
|
330
377
|
* All tokens bundled together for convenience
|
|
@@ -482,6 +529,7 @@ export declare const tokens: {
|
|
|
482
529
|
colors: {
|
|
483
530
|
acct: Record<string, string>;
|
|
484
531
|
pos: Record<string, string>;
|
|
532
|
+
ai: Record<"accent" | "fill" | "border" | "user-bubble" | "assistant-bubble" | "focus", string>;
|
|
485
533
|
secondary: "#000000";
|
|
486
534
|
success: "#057A54";
|
|
487
535
|
warning: "#F5A524";
|
|
@@ -554,5 +602,18 @@ export declare const tokens: {
|
|
|
554
602
|
readonly normal: "1.5";
|
|
555
603
|
readonly relaxed: "1.75";
|
|
556
604
|
};
|
|
605
|
+
keyframes: {
|
|
606
|
+
'record-shimmer': {
|
|
607
|
+
'0%': {
|
|
608
|
+
backgroundPosition: string;
|
|
609
|
+
};
|
|
610
|
+
'100%': {
|
|
611
|
+
backgroundPosition: string;
|
|
612
|
+
};
|
|
613
|
+
};
|
|
614
|
+
};
|
|
615
|
+
animation: {
|
|
616
|
+
'record-shimmer': string;
|
|
617
|
+
};
|
|
557
618
|
};
|
|
558
619
|
};
|
package/dist/tailwind/index.mjs
CHANGED
|
@@ -219,12 +219,12 @@ function adminSurfaceCss({
|
|
|
219
219
|
scope = ".acct",
|
|
220
220
|
fontFamily = "'NeueMontreal', system-ui, sans-serif"
|
|
221
221
|
} = {}) {
|
|
222
|
-
const
|
|
222
|
+
const declarations2 = Object.entries(adminSurfaceTokens).map(([name, value]) => ` ${name}: ${value};`).join("\n");
|
|
223
223
|
const typography2 = fontFamily ? `
|
|
224
224
|
font-family: ${fontFamily};
|
|
225
225
|
color: var(--ink);` : "";
|
|
226
226
|
return `${scope} {
|
|
227
|
-
${
|
|
227
|
+
${declarations2}${typography2}
|
|
228
228
|
}
|
|
229
229
|
`;
|
|
230
230
|
}
|
|
@@ -235,6 +235,17 @@ var posSurfaceTokens = {
|
|
|
235
235
|
line: "#E7E7E9",
|
|
236
236
|
/** `--line2`: the lighter hairline under list rows and above the role bar. */
|
|
237
237
|
"line-2": "#F1F1F3",
|
|
238
|
+
hair: "#F0F0F1",
|
|
239
|
+
page: "#FBFBFB",
|
|
240
|
+
field: "#E5E5E5",
|
|
241
|
+
/** A hairline under the pointer (`default-300`). */
|
|
242
|
+
"line-strong": "#D4D4D8",
|
|
243
|
+
/** `--ink`: body text (`default-900`). */
|
|
244
|
+
ink: "#18181B",
|
|
245
|
+
/** `--muted`: secondary text and eyebrows, 4.83:1 on white (`default-500`). */
|
|
246
|
+
muted: "#71717A",
|
|
247
|
+
/** Placeholder text (`default-400`). Never for content: 2.56:1 on white. */
|
|
248
|
+
faint: "#A1A1AA",
|
|
238
249
|
/** `--okb` / `--okf` */
|
|
239
250
|
"ok-fill": "#EAF3DE",
|
|
240
251
|
ok: "#3B6D11",
|
|
@@ -249,11 +260,79 @@ var posSurfaceTokens = {
|
|
|
249
260
|
/** `--ib` / `--if` */
|
|
250
261
|
"info-fill": "#EAF1FC",
|
|
251
262
|
info: "#1D4FA8",
|
|
263
|
+
"violet-fill": "#F1ECFB",
|
|
264
|
+
violet: "#6D28D9",
|
|
265
|
+
"neutral-fill": "#F4F4F5",
|
|
266
|
+
neutral: "#52525B",
|
|
252
267
|
/** `.btn-dstr` — the fill behind an irreversible confirmation. */
|
|
253
268
|
destructive: "#A32D2D"
|
|
254
269
|
};
|
|
255
270
|
var posSurfaceTailwindColors = { ...posSurfaceTokens };
|
|
256
271
|
|
|
272
|
+
// src/tokens/assistant-surface.ts
|
|
273
|
+
var info = colors.palettes.info;
|
|
274
|
+
var HEROUI_CONTENT = {
|
|
275
|
+
light: { content1: "#ffffff", content2: "#f4f4f5" },
|
|
276
|
+
dark: { content1: "#18181b", content2: "#27272a" }
|
|
277
|
+
};
|
|
278
|
+
var ASSISTANT_SURFACE_TOKEN_NAMES = [
|
|
279
|
+
/** Text and icon tone that marks something as the assistant's. */
|
|
280
|
+
"accent",
|
|
281
|
+
/** Tint behind small assistant marks (an avatar disc, an info notice). */
|
|
282
|
+
"fill",
|
|
283
|
+
/** Hairline around assistant regions. */
|
|
284
|
+
"border",
|
|
285
|
+
/** Fill of the person's own turn. */
|
|
286
|
+
"user-bubble",
|
|
287
|
+
/** Fill of the assistant's turn, where an app draws it as a bubble. */
|
|
288
|
+
"assistant-bubble",
|
|
289
|
+
/** Focus ring inside assistant surfaces. */
|
|
290
|
+
"focus"
|
|
291
|
+
];
|
|
292
|
+
var assistantSurfaceTokens = {
|
|
293
|
+
light: {
|
|
294
|
+
accent: info[600],
|
|
295
|
+
fill: info[100],
|
|
296
|
+
border: info[200],
|
|
297
|
+
"user-bubble": HEROUI_CONTENT.light.content2,
|
|
298
|
+
"assistant-bubble": HEROUI_CONTENT.light.content1,
|
|
299
|
+
focus: info[500]
|
|
300
|
+
},
|
|
301
|
+
dark: {
|
|
302
|
+
accent: info[300],
|
|
303
|
+
fill: info[900],
|
|
304
|
+
border: info[800],
|
|
305
|
+
"user-bubble": HEROUI_CONTENT.dark.content2,
|
|
306
|
+
"assistant-bubble": HEROUI_CONTENT.dark.content1,
|
|
307
|
+
focus: info[400]
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
function hexToChannels(hex) {
|
|
311
|
+
if (!/^#[0-9a-f]{6}$/i.test(hex)) throw new Error(`bad hex: ${hex}`);
|
|
312
|
+
return [1, 3, 5].map((start) => parseInt(hex.slice(start, start + 2), 16)).join(" ");
|
|
313
|
+
}
|
|
314
|
+
var assistantSurfaceVar = (name) => `--ai-${name}`;
|
|
315
|
+
var declarations = (theme) => Object.fromEntries(
|
|
316
|
+
ASSISTANT_SURFACE_TOKEN_NAMES.map((name) => [
|
|
317
|
+
assistantSurfaceVar(name),
|
|
318
|
+
hexToChannels(assistantSurfaceTokens[theme][name])
|
|
319
|
+
])
|
|
320
|
+
);
|
|
321
|
+
var ASSISTANT_SURFACE_SELECTORS = {
|
|
322
|
+
light: ':root, .light, [data-theme="light"]',
|
|
323
|
+
dark: ".dark"
|
|
324
|
+
};
|
|
325
|
+
var assistantSurfaceBase = {
|
|
326
|
+
[ASSISTANT_SURFACE_SELECTORS.light]: declarations("light"),
|
|
327
|
+
[ASSISTANT_SURFACE_SELECTORS.dark]: declarations("dark")
|
|
328
|
+
};
|
|
329
|
+
var assistantSurfaceTailwindColors = Object.fromEntries(
|
|
330
|
+
ASSISTANT_SURFACE_TOKEN_NAMES.map((name) => [
|
|
331
|
+
name,
|
|
332
|
+
`rgb(var(${assistantSurfaceVar(name)}, ${hexToChannels(assistantSurfaceTokens.light[name])}) / <alpha-value>)`
|
|
333
|
+
])
|
|
334
|
+
);
|
|
335
|
+
|
|
257
336
|
// src/tailwind/index.ts
|
|
258
337
|
var tailwindTheme = {
|
|
259
338
|
colors: {
|
|
@@ -269,13 +348,26 @@ var tailwindTheme = {
|
|
|
269
348
|
// `danger`/`info`/`warn` do not shadow the semantic palettes, and fed
|
|
270
349
|
// from the token object so utility and token cannot disagree.
|
|
271
350
|
// See src/tokens/pos-surface.ts.
|
|
272
|
-
pos: posSurfaceTailwindColors
|
|
351
|
+
pos: posSurfaceTailwindColors,
|
|
352
|
+
// Assistant palette. Unlike `acct`/`pos` these resolve to CSS custom
|
|
353
|
+
// properties, because they have a dark value: the preset's plugin
|
|
354
|
+
// below writes the properties. See src/tokens/assistant-surface.ts.
|
|
355
|
+
ai: assistantSurfaceTailwindColors
|
|
273
356
|
},
|
|
274
357
|
fontFamily: typography.fontFamily,
|
|
275
358
|
spacing,
|
|
276
359
|
fontSize: typography.fontSize,
|
|
277
360
|
fontWeight: typography.fontWeight,
|
|
278
|
-
lineHeight: typography.lineHeight
|
|
361
|
+
lineHeight: typography.lineHeight,
|
|
362
|
+
keyframes: {
|
|
363
|
+
"record-shimmer": {
|
|
364
|
+
"0%": { backgroundPosition: "-25rem 0" },
|
|
365
|
+
"100%": { backgroundPosition: "25rem 0" }
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
animation: {
|
|
369
|
+
"record-shimmer": "record-shimmer 1.3s linear infinite"
|
|
370
|
+
}
|
|
279
371
|
};
|
|
280
372
|
function deepMerge(target, source) {
|
|
281
373
|
if (!source || typeof source !== "object") {
|
|
@@ -339,11 +431,15 @@ var veevartContent = [
|
|
|
339
431
|
"./node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}",
|
|
340
432
|
"./node_modules/@veevarts/design-system/dist/**/*.{js,mjs,jsx,tsx}"
|
|
341
433
|
];
|
|
434
|
+
function assistantSurfacePlugin({ addBase }) {
|
|
435
|
+
addBase(assistantSurfaceBase);
|
|
436
|
+
}
|
|
342
437
|
var veevartPreset = {
|
|
343
438
|
theme: {
|
|
344
439
|
extend: tailwindTheme
|
|
345
440
|
},
|
|
346
|
-
darkMode: "class"
|
|
441
|
+
darkMode: "class",
|
|
442
|
+
plugins: [assistantSurfacePlugin]
|
|
347
443
|
};
|
|
348
444
|
var tokens = {
|
|
349
445
|
colors,
|
|
@@ -355,6 +451,9 @@ export {
|
|
|
355
451
|
adminSurfaceCss,
|
|
356
452
|
adminSurfaceTailwindColors,
|
|
357
453
|
adminSurfaceTokens,
|
|
454
|
+
assistantSurfacePlugin,
|
|
455
|
+
assistantSurfaceTailwindColors,
|
|
456
|
+
assistantSurfaceTokens,
|
|
358
457
|
colors,
|
|
359
458
|
createHeroUIConfig,
|
|
360
459
|
deepMerge,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The opaque colour actually painted behind `element`: its own background and
|
|
3
|
+
* every ancestor's, composited from the nearest opaque one down, over white.
|
|
4
|
+
*
|
|
5
|
+
* Contrast has to be measured against this, not against the element's own
|
|
6
|
+
* `backgroundColor`: HeroUI's flat fills are translucent in dark mode
|
|
7
|
+
* (`dark:bg-danger-50/50`), so the computed value alone reads as a colour
|
|
8
|
+
* nobody sees.
|
|
9
|
+
*/
|
|
10
|
+
export declare function backdropColor(element: Element): string;
|
|
11
|
+
/** `#1d4ed8` → `rgb(29, 78, 216)`, the form `getComputedStyle` reports. */
|
|
12
|
+
export declare function rgbOf(hex: string): string;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class FakeResizeObserver {
|
|
2
|
+
static width: number;
|
|
3
|
+
static instances: FakeResizeObserver[];
|
|
4
|
+
disconnected: boolean;
|
|
5
|
+
private readonly callback;
|
|
6
|
+
private readonly targets;
|
|
7
|
+
constructor(callback: ResizeObserverCallback);
|
|
8
|
+
observe(target: Element): void;
|
|
9
|
+
unobserve(): void;
|
|
10
|
+
disconnect(): void;
|
|
11
|
+
emit(width: number): void;
|
|
12
|
+
}
|
|
13
|
+
export declare function stubContainerWidth(width: number): void;
|
|
14
|
+
export declare function resizeContainers(width: number): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function contrastRatio(a: string, b: string): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const pxClasses: (root: Element) => string[];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Story helpers for checking a `motion-reduce:` utility in a real browser without changing the
|
|
3
|
+
* browser's media.
|
|
4
|
+
*
|
|
5
|
+
* A page cannot turn `prefers-reduced-motion` on for itself, and emulating it through the
|
|
6
|
+
* runner's CDP session changes the whole page, which Vitest shares between story files running
|
|
7
|
+
* in parallel: another story measuring its own animation in that window would read `none`. So
|
|
8
|
+
* the reduced-motion half is proved from the page's compiled CSS instead, which is what the
|
|
9
|
+
* browser applies anyway:
|
|
10
|
+
*
|
|
11
|
+
* 1. the element carries the still class;
|
|
12
|
+
* 2. that class sets `animation-name: none` inside `@media (prefers-reduced-motion: reduce)`;
|
|
13
|
+
* 3. it comes later in the stylesheet than the rule that starts the animation. Both are one class
|
|
14
|
+
* (plus the same pseudo-element), so at equal specificity the later rule wins.
|
|
15
|
+
*
|
|
16
|
+
* The motion-allowed half is read straight off `getComputedStyle`.
|
|
17
|
+
*/
|
|
18
|
+
export interface ReducedMotionCascade {
|
|
19
|
+
/** The element carries both classes. */
|
|
20
|
+
carriesBoth: boolean;
|
|
21
|
+
/** `animation-name` of the rule that starts the motion (e.g. `shimmer`), or `undefined`. */
|
|
22
|
+
movingAnimation: string | undefined;
|
|
23
|
+
/** `animation-name` the still class sets under reduced motion (`none`), or `undefined`. */
|
|
24
|
+
stillAnimation: string | undefined;
|
|
25
|
+
/** The still rule is later in the cascade than the moving one, so it wins. */
|
|
26
|
+
stillComesLater: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What the stylesheets say happens to `movingClass`'s animation on `element` (or its `pseudo`)
|
|
30
|
+
* when the OS asks for reduced motion and `stillClass` is the utility meant to stop it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function reducedMotionCascade(element: Element, { movingClass, stillClass, pseudo }: {
|
|
33
|
+
movingClass: string;
|
|
34
|
+
stillClass: string;
|
|
35
|
+
pseudo?: '' | '::before';
|
|
36
|
+
}): ReducedMotionCascade;
|
|
37
|
+
/** Whether the reader's OS currently asks for reduced motion (the Storybook UI is theirs). */
|
|
38
|
+
export declare function osReducesMotion(): boolean;
|
|
39
|
+
/** The `animation-name` running on an element's `::before`, where HeroUI draws the skeleton shimmer. */
|
|
40
|
+
export declare function beforeAnimationName(element: Element): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
export declare const LARGE_TEXT_ROOT = "137.5%";
|
|
3
|
+
export declare const LARGE_TEXT_SCALE = 1.375;
|
|
4
|
+
export declare const withRootFontSize: (size: string) => (Story: ComponentType) => import('react').FunctionComponentElement<{
|
|
5
|
+
size: string;
|
|
6
|
+
children?: import('react').ReactNode;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const fontSizePx: (element: Element) => number;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The assistant ("AI") palette: the one place an assistant surface takes its
|
|
3
|
+
* accent, tints and focus ring from, in light AND dark (INI-0581).
|
|
4
|
+
*
|
|
5
|
+
* PLACEHOLDER HUE. Design has not picked the assistant colour yet. These
|
|
6
|
+
* values are the `info` blue scale, the only hue in the DS that no product
|
|
7
|
+
* already uses for something else, and they ship so the assistant pieces can
|
|
8
|
+
* be built and measured now. When Design signs a hue off, change the two maps
|
|
9
|
+
* below and nothing else: every `ai-*` utility, the CSS custom properties and
|
|
10
|
+
* the contrast tests all read from here. The two bubbles are neutrals on
|
|
11
|
+
* purpose (only the assistant carries the hue); Design may retune them too.
|
|
12
|
+
*
|
|
13
|
+
* WHY IT CARRIES ITS OWN DARK VALUES. The DS has no dark theme:
|
|
14
|
+
* `createHeroUIConfig` builds `themes.light` only. HeroUI's semantic colours
|
|
15
|
+
* (`content1`, `foreground`, `default-*`, `divider`) still flip under `.dark`,
|
|
16
|
+
* so the assistant pieces style with those plus this palette, and this
|
|
17
|
+
* palette flips with them. A full DS dark theme is a separate, larger piece
|
|
18
|
+
* of work.
|
|
19
|
+
*
|
|
20
|
+
* HOW IT REACHES THE PAGE. The preset adds a plugin that writes each token as
|
|
21
|
+
* a custom property and maps `ai-*` colours to those properties. **The class
|
|
22
|
+
* is the switch:** dark values under `.dark`, light values on `:root`,
|
|
23
|
+
* `.light` and `[data-theme="light"]`. Those are the selectors every HeroUI
|
|
24
|
+
* 2.x in the DS peer range writes its own variables under, so the palette and
|
|
25
|
+
* HeroUI's colours flip together; `src/tailwind/__test__/assistant-heroui-parity.test.ts`
|
|
26
|
+
* holds that against the installed HeroUI. `[data-theme="dark"]` is NOT a
|
|
27
|
+
* switch: HeroUI 2.8 no longer writes dark variables there (2.7 still did),
|
|
28
|
+
* so honouring it would turn `ai-*` dark on white HeroUI cards. An app that
|
|
29
|
+
* puts `.dark` on a subtree gets dark values on that subtree only.
|
|
30
|
+
*
|
|
31
|
+
* Kept apart from `adminSurfaceTokens` on purpose: consumers test that they
|
|
32
|
+
* override every admin token, and a new key there would break them.
|
|
33
|
+
*/
|
|
34
|
+
/** The token names, in the order the docs list them. */
|
|
35
|
+
export declare const ASSISTANT_SURFACE_TOKEN_NAMES: readonly ["accent", "fill", "border", "user-bubble", "assistant-bubble", "focus"];
|
|
36
|
+
export type AssistantSurfaceTokenName = (typeof ASSISTANT_SURFACE_TOKEN_NAMES)[number];
|
|
37
|
+
export type AssistantSurfaceTheme = 'light' | 'dark';
|
|
38
|
+
/** Token name → hex, per theme. Exported so tests and tooling can assert on it directly. */
|
|
39
|
+
export declare const assistantSurfaceTokens: Record<AssistantSurfaceTheme, Record<AssistantSurfaceTokenName, string>>;
|
|
40
|
+
/**
|
|
41
|
+
* `#1d4ed8` → `29 78 216`: the channel form Tailwind's `<alpha-value>` needs.
|
|
42
|
+
* Throws on anything but `#rrggbb`, so a typo in a hue change fails the tests
|
|
43
|
+
* instead of shipping a colour that resolves to nothing.
|
|
44
|
+
*/
|
|
45
|
+
export declare function hexToChannels(hex: string): string;
|
|
46
|
+
/** The custom property behind a token: `accent` → `--ai-accent`. */
|
|
47
|
+
export declare const assistantSurfaceVar: (name: AssistantSurfaceTokenName) => string;
|
|
48
|
+
/**
|
|
49
|
+
* Where each theme's values are written: the selectors every HeroUI 2.x in
|
|
50
|
+
* the peer range writes its own light and dark variables under (see the module
|
|
51
|
+
* comment for why `[data-theme="dark"]` is left out). A `.light` island inside
|
|
52
|
+
* a `.dark` page flips back for both palettes at once.
|
|
53
|
+
*/
|
|
54
|
+
export declare const ASSISTANT_SURFACE_SELECTORS: Record<AssistantSurfaceTheme, string>;
|
|
55
|
+
/** The custom properties as a CSS-in-JS rule set, ready for Tailwind's `addBase`. */
|
|
56
|
+
export declare const assistantSurfaceBase: Record<string, Record<string, string>>;
|
|
57
|
+
/**
|
|
58
|
+
* The palette as Tailwind colours, namespaced under `ai`: `text-ai-accent`,
|
|
59
|
+
* `bg-ai-user-bubble`, `ring-ai-focus`, with opacity modifiers working.
|
|
60
|
+
*
|
|
61
|
+
* Each colour falls back to its LIGHT value when the property is missing, so
|
|
62
|
+
* an app that extends `tokens.tailwindTheme` without the preset's plugin still
|
|
63
|
+
* gets a readable light palette instead of colours that resolve to nothing.
|
|
64
|
+
* Dark values need the plugin.
|
|
65
|
+
*/
|
|
66
|
+
export declare const assistantSurfaceTailwindColors: Record<AssistantSurfaceTokenName, string>;
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -3,5 +3,7 @@ export { spacing } from './spacing';
|
|
|
3
3
|
export { typography } from './typography';
|
|
4
4
|
export { adminSurfaceCss, adminSurfaceTokens } from './admin-surface';
|
|
5
5
|
export { posSurfaceTokens, posSurfaceTailwindColors } from './pos-surface';
|
|
6
|
+
export { assistantSurfaceTokens } from './assistant-surface';
|
|
6
7
|
export type { ColorToken } from './colors';
|
|
7
8
|
export type { AdminSurfaceCssOptions } from './admin-surface';
|
|
9
|
+
export type { AssistantSurfaceTheme, AssistantSurfaceTokenName } from './assistant-surface';
|