@polastack/design-system 0.1.8 → 0.1.10

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/dist/index.d.ts CHANGED
@@ -687,53 +687,57 @@ declare const ChartContainer: React.ForwardRefExoticComponent<ChartContainerProp
687
687
 
688
688
  /**
689
689
  * Chart theme tokens for integrating charting libraries (Recharts, Chart.js, etc.)
690
- * with the Polastack design system color palette.
690
+ * with the Polastack design system.
691
+ *
692
+ * Design approach:
693
+ * - Categorical palette is hand-curated for perceptual balance (Tableau 10 methodology)
694
+ * - Colors are independent from UI semantic tokens (Primer / shadcn best practice)
695
+ * - Each categorical color has a 1:1 paired subtle variant for area fills (Primer emphasis/muted pattern)
696
+ * - Brand teal anchors position 0; remaining hues span the full wheel for maximum distinction
691
697
  *
692
698
  * Usage with Recharts:
693
- * <Bar fill={chartColors.series[0]} />
699
+ * <Bar fill={chartColors.categorical[0]} />
700
+ * <Area fill={chartColors.subtle[0]} stroke={chartColors.categorical[0]} />
694
701
  *
695
702
  * Usage with Chart.js:
696
- * datasets: [{ backgroundColor: chartColors.series }]
703
+ * datasets: [{ backgroundColor: chartColors.categorical }]
704
+ */
705
+ /**
706
+ * 8-color categorical palette — curated for data visualization.
707
+ *
708
+ * Principles:
709
+ * 1. Moderate saturation ("less Crayola bright") for professional look
710
+ * 2. Balanced perceived lightness across all 8 hues
711
+ * 3. Full hue-circle coverage for maximum distinguishability
712
+ * 4. Warm/cool alternation to aid colorblind accessibility
713
+ * 5. Brand teal as the anchor color at position 0
697
714
  */
698
- /** Ordered color series for chart data — distinct, accessible, brand-consistent. */
699
715
  declare const chartColors: {
700
- /**
701
- * Primary data series palette (use in order for multi-series charts).
702
- * Uses 400-level tones for a softer, more cohesive look in filled areas
703
- * (bars, pie slices, etc.). Brand teal stays at 500 as the anchor.
704
- */
705
- readonly series: readonly ["#1BA491", "#60a5fa", "#a1a1aa", "#fbbf24", "#4ade80", "#fca5a5", "#61ebd0", "#93c5fd"];
706
- /**
707
- * Stronger series — for line charts and small marks (dots, strokes)
708
- * where higher contrast is needed against the background.
709
- */
710
- readonly stroke: readonly ["#138575", "#2563eb", "#71717a", "#d97706", "#16a34a", "#ef4444", "#146b5f", "#1d4ed8"];
711
- /** Semantic colors for status-based charts */
716
+ /** Solid colors for bars, lines, dots, and legends */
717
+ readonly categorical: readonly ["#1BA491", "#4E79A7", "#E8A838", "#D4687A", "#7C6BB1", "#6BA368", "#5BA4CF", "#B07A53"];
718
+ /** Subtle tints 1:1 paired with categorical for area fills and backgrounds */
719
+ readonly subtle: readonly ["#E6F7F4", "#E8EEF4", "#FDF3E0", "#FCEAED", "#EEEBF5", "#EAF3EA", "#E6F1F8", "#F4EDE6"];
720
+ /** Dark-mode subtle tints — 1:1 paired with categorical */
721
+ readonly subtleDark: readonly ["#0C2B26", "#1A2535", "#2C2312", "#2C1A1E", "#1E1A2C", "#1A2C1A", "#1A2535", "#2C2418"];
722
+ /** Semantic colors for status-meaning charts (P&L, health scores, etc.) */
712
723
  readonly semantic: {
713
- readonly positive: "#4ade80";
714
- readonly negative: "#f87171";
715
- readonly neutral: "#a1a1aa";
716
- readonly warning: "#fbbf24";
717
- readonly info: "#60a5fa";
718
- readonly primary: "#1BA491";
724
+ readonly positive: "#1BA491";
725
+ readonly negative: "#D4687A";
726
+ readonly neutral: "#94939B";
727
+ readonly warning: "#E8A838";
719
728
  };
720
- /** Light fills for area/background (light mode) — very subtle */
721
- readonly areaLight: readonly ["#f0fdfb", "#eff6ff", "#f4f4f5", "#fffbeb", "#f0fdf4"];
722
- /** Dark fills for area/background (dark mode) */
723
- readonly areaDark: readonly ["#042c28", "#172554", "#27272a", "#451a03", "#052e16"];
724
- /** Grid and axis colors (use CSS variables for dark mode compatibility) */
729
+ /** Grid lines and axis strokes */
725
730
  readonly grid: {
726
- readonly light: "#e4e4e7";
727
- readonly dark: "#3f3f46";
731
+ readonly light: "#E4E4E7";
732
+ readonly dark: "#3F3F46";
728
733
  };
729
- /** Text colors for labels and legends */
734
+ /** Text for tick labels, legends, and annotations */
730
735
  readonly text: {
731
- readonly light: "#71717a";
732
- readonly dark: "#a1a1aa";
736
+ readonly light: "#71717A";
737
+ readonly dark: "#A1A1AA";
733
738
  };
734
739
  };
735
- type ChartColorSeries = typeof chartColors.series;
736
- type ChartStrokeColors = typeof chartColors.stroke;
740
+ type ChartCategoricalColors = typeof chartColors.categorical;
737
741
  type ChartSemanticColors = typeof chartColors.semantic;
738
742
 
739
- export { ActiveFilters, type ActiveFiltersProps, AppShell, AppShellContent, AppShellFooter, AppShellHeader, type AppShellProps, AppShellSidebar, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarStatus, type AvatarStatusProps, type AvatarStatusType, BREAKPOINTS, Badge, type BadgeProps, BottomNavigation, BottomNavigationItem, type BottomNavigationItemProps, type BottomNavigationProps, type Breakpoint, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartColorSeries, ChartContainer, type ChartContainerProps, type ChartSemanticColors, type ChartStrokeColors, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, type CommandPaletteGroupProps, CommandPaletteItem, type CommandPaletteItemProps, type CommandPaletteProps, CommandPaletteSeparator, CommandPaletteShortcut, DataTable, DataTableColumnHeader, DataTablePagination, type DataTableProps, DataTableToolbar, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, type DisplayMode, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, type DrawerProps, DrawerProvider, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFormField, type DynamicFormFieldProps, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, type EmptyStateProps, EmptyStateTitle, type FieldOption, type FieldType, FilterBar, FilterBarActions, FilterBarGroup, FilterChip, type FilterChipProps, FormActions, type FormActionsProps, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormLayout, type FormLayoutProps, FormMessage, type FormMessageProps, FormSection, type FormSectionProps, Input, type InputProps, InstallPrompt, type InstallPromptProps, Label, type LabelProps, NumberInput, type NumberInputProps, OfflineIndicator, type OfflineIndicatorProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PullToRefresh, type PullToRefreshProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type ResolvedTheme, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsListProps, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseThemeOptions, type UseThemeReturn, avatarVariants, badgeVariants, buttonVariants, chartColors, cn, createContext, formLayoutVariants, getFieldComponent, inputVariants, spinnerVariants, switchVariants, textareaVariants, toast, toastVariants, useAppShell, useBreakpoint, useDisplayMode, useFormField, useInstallPrompt, useOnlineStatus, useTheme$1 as useTheme, useTheme as useThemeContext, useToast, useViewportHeight };
743
+ export { ActiveFilters, type ActiveFiltersProps, AppShell, AppShellContent, AppShellFooter, AppShellHeader, type AppShellProps, AppShellSidebar, Avatar, AvatarFallback, type AvatarFallbackProps, AvatarGroup, type AvatarGroupProps, AvatarImage, type AvatarImageProps, type AvatarProps, AvatarStatus, type AvatarStatusProps, type AvatarStatusType, BREAKPOINTS, Badge, type BadgeProps, BottomNavigation, BottomNavigationItem, type BottomNavigationItemProps, type BottomNavigationProps, type Breakpoint, Button, type ButtonProps, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, type ChartCategoricalColors, ChartContainer, type ChartContainerProps, type ChartSemanticColors, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, CommandPalette, CommandPaletteEmpty, CommandPaletteGroup, type CommandPaletteGroupProps, CommandPaletteItem, type CommandPaletteItemProps, type CommandPaletteProps, CommandPaletteSeparator, CommandPaletteShortcut, DataTable, DataTableColumnHeader, DataTablePagination, type DataTableProps, DataTableToolbar, DatePicker, type DatePickerProps, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogTitle, DialogTrigger, type DisplayMode, Drawer, DrawerClose, DrawerContent, type DrawerContentProps, DrawerDescription, DrawerFooter, DrawerHeader, type DrawerProps, DrawerProvider, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, type DropdownMenuItemProps, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, DynamicFormField, type DynamicFormFieldProps, EmptyState, EmptyStateActions, EmptyStateDescription, EmptyStateIcon, type EmptyStateProps, EmptyStateTitle, type FieldOption, type FieldType, FilterBar, FilterBarActions, FilterBarGroup, FilterChip, type FilterChipProps, FormActions, type FormActionsProps, FormControl, type FormControlProps, FormDescription, type FormDescriptionProps, FormField, type FormFieldProps, FormLabel, type FormLabelProps, FormLayout, type FormLayoutProps, FormMessage, type FormMessageProps, FormSection, type FormSectionProps, Input, type InputProps, InstallPrompt, type InstallPromptProps, Label, type LabelProps, NumberInput, type NumberInputProps, OfflineIndicator, type OfflineIndicatorProps, Popover, PopoverAnchor, PopoverContent, PopoverTrigger, PullToRefresh, type PullToRefreshProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, type RadioGroupProps, type ResolvedTheme, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectSeparator, SelectTrigger, SelectValue, Separator, type SeparatorProps, Skeleton, type SkeletonProps, Spinner, type SpinnerProps, StatCard, type StatCardProps, Switch, type SwitchProps, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, type TabsListProps, TabsTrigger, Textarea, type TextareaProps, type Theme, ThemeProvider, type ThemeProviderProps, Toast, ToastAction, type ToastActionElement, ToastClose, ToastDescription, type ToastProps, ToastProvider, ToastTitle, ToastViewport, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, type UseThemeOptions, type UseThemeReturn, avatarVariants, badgeVariants, buttonVariants, chartColors, cn, createContext, formLayoutVariants, getFieldComponent, inputVariants, spinnerVariants, switchVariants, textareaVariants, toast, toastVariants, useAppShell, useBreakpoint, useDisplayMode, useFormField, useInstallPrompt, useOnlineStatus, useTheme$1 as useTheme, useTheme as useThemeContext, useToast, useViewportHeight };
package/dist/index.js CHANGED
@@ -1,7 +1,3 @@
1
- import {
2
- colors
3
- } from "./chunk-Q6XRSLLQ.js";
4
-
5
1
  // src/lib/cn.ts
6
2
  import { clsx } from "clsx";
7
3
  import { twMerge } from "tailwind-merge";
@@ -3757,85 +3753,83 @@ ChartContainer.displayName = "ChartContainer";
3757
3753
 
3758
3754
  // src/tokens/chart-theme.ts
3759
3755
  var chartColors = {
3760
- /**
3761
- * Primary data series palette (use in order for multi-series charts).
3762
- * Uses 400-level tones for a softer, more cohesive look in filled areas
3763
- * (bars, pie slices, etc.). Brand teal stays at 500 as the anchor.
3764
- */
3765
- series: [
3766
- colors.primary[500],
3767
- // #1BA491 brand teal (anchor)
3768
- colors.info[400],
3769
- // #60a5fa soft blue
3770
- colors.neutral[400],
3771
- // #a1a1aa muted gray
3772
- colors.warning[400],
3773
- // #fbbf24 soft amber
3774
- colors.success[400],
3775
- // #4ade80 soft green
3776
- colors.error[300],
3777
- // #fca5a5 soft coral
3778
- colors.primary[300],
3779
- // #61ebd0 light teal
3780
- colors.info[300]
3781
- // #93c5fd light blue
3756
+ /** Solid colors for bars, lines, dots, and legends */
3757
+ categorical: [
3758
+ "#1BA491",
3759
+ // teal brand anchor
3760
+ "#4E79A7",
3761
+ // slate — classic dataviz blue
3762
+ "#E8A838",
3763
+ // amber — warm gold
3764
+ "#D4687A",
3765
+ // rose — dusty pink-red
3766
+ "#7C6BB1",
3767
+ // violet — soft purple
3768
+ "#6BA368",
3769
+ // sage — muted green
3770
+ "#5BA4CF",
3771
+ // sky — lighter blue
3772
+ "#B07A53"
3773
+ // sienna — warm brown
3774
+ ],
3775
+ /** Subtle tints — 1:1 paired with categorical for area fills and backgrounds */
3776
+ subtle: [
3777
+ "#E6F7F4",
3778
+ // teal
3779
+ "#E8EEF4",
3780
+ // slate
3781
+ "#FDF3E0",
3782
+ // amber
3783
+ "#FCEAED",
3784
+ // rose
3785
+ "#EEEBF5",
3786
+ // violet
3787
+ "#EAF3EA",
3788
+ // sage
3789
+ "#E6F1F8",
3790
+ // sky
3791
+ "#F4EDE6"
3792
+ // sienna
3782
3793
  ],
3783
- /**
3784
- * Stronger series — for line charts and small marks (dots, strokes)
3785
- * where higher contrast is needed against the background.
3786
- */
3787
- stroke: [
3788
- colors.primary[600],
3789
- // #138575 deep teal
3790
- colors.info[600],
3791
- // #2563eb deep blue
3792
- colors.neutral[500],
3793
- // #71717a medium gray
3794
- colors.warning[600],
3795
- // #d97706 deep amber
3796
- colors.success[600],
3797
- // #16a34a deep green
3798
- colors.error[500],
3799
- // #ef4444 red
3800
- colors.primary[700],
3801
- // #146b5f dark teal
3802
- colors.info[700]
3803
- // #1d4ed8 dark blue
3794
+ /** Dark-mode subtle tints — 1:1 paired with categorical */
3795
+ subtleDark: [
3796
+ "#0C2B26",
3797
+ // teal
3798
+ "#1A2535",
3799
+ // slate
3800
+ "#2C2312",
3801
+ // amber
3802
+ "#2C1A1E",
3803
+ // rose
3804
+ "#1E1A2C",
3805
+ // violet
3806
+ "#1A2C1A",
3807
+ // sage
3808
+ "#1A2535",
3809
+ // sky
3810
+ "#2C2418"
3811
+ // sienna
3804
3812
  ],
3805
- /** Semantic colors for status-based charts */
3813
+ /** Semantic colors for status-meaning charts (P&L, health scores, etc.) */
3806
3814
  semantic: {
3807
- positive: colors.success[400],
3808
- negative: colors.error[400],
3809
- neutral: colors.neutral[400],
3810
- warning: colors.warning[400],
3811
- info: colors.info[400],
3812
- primary: colors.primary[500]
3815
+ positive: "#1BA491",
3816
+ negative: "#D4687A",
3817
+ neutral: "#94939B",
3818
+ warning: "#E8A838"
3813
3819
  },
3814
- /** Light fills for area/background (light mode) — very subtle */
3815
- areaLight: [
3816
- colors.primary[50],
3817
- colors.info[50],
3818
- colors.neutral[100],
3819
- colors.warning[50],
3820
- colors.success[50]
3821
- ],
3822
- /** Dark fills for area/background (dark mode) */
3823
- areaDark: [
3824
- colors.primary[950],
3825
- colors.info[950],
3826
- colors.neutral[800],
3827
- colors.warning[950],
3828
- colors.success[950]
3829
- ],
3830
- /** Grid and axis colors (use CSS variables for dark mode compatibility) */
3820
+ /** Grid lines and axis strokes */
3831
3821
  grid: {
3832
- light: colors.neutral[200],
3833
- dark: colors.neutral[700]
3822
+ light: "#E4E4E7",
3823
+ // neutral-200
3824
+ dark: "#3F3F46"
3825
+ // neutral-700
3834
3826
  },
3835
- /** Text colors for labels and legends */
3827
+ /** Text for tick labels, legends, and annotations */
3836
3828
  text: {
3837
- light: colors.neutral[500],
3838
- dark: colors.neutral[400]
3829
+ light: "#71717A",
3830
+ // neutral-500
3831
+ dark: "#A1A1AA"
3832
+ // neutral-400
3839
3833
  }
3840
3834
  };
3841
3835
  export {