@refraction-ui/astro 0.13.0 → 0.14.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 (47) hide show
  1. package/dist/astro-audience-feature-card/AudienceFeatureCard.astro +53 -0
  2. package/dist/astro-audience-feature-card/index.ts +1 -0
  3. package/dist/astro-brand-network-cell/BrandNetworkCell.astro +77 -0
  4. package/dist/astro-brand-network-cell/index.ts +1 -0
  5. package/dist/astro-browser-chrome-mock/BrowserChromeMock.astro +62 -0
  6. package/dist/astro-browser-chrome-mock/index.ts +1 -0
  7. package/dist/astro-marquee-strip/MarqueeStrip.astro +63 -0
  8. package/dist/astro-marquee-strip/index.ts +1 -0
  9. package/dist/astro-mastery-bar/MasteryBar.astro +56 -0
  10. package/dist/astro-mastery-bar/index.ts +1 -0
  11. package/dist/astro-numbered-steps/NumberedSteps.astro +47 -0
  12. package/dist/astro-numbered-steps/index.ts +1 -0
  13. package/dist/astro-pricing-card/PricingCard.astro +114 -0
  14. package/dist/astro-pricing-card/index.ts +1 -0
  15. package/dist/astro-section-head/SectionHead.astro +44 -0
  16. package/dist/astro-section-head/index.ts +1 -0
  17. package/dist/astro-stat-grid/StatGrid.astro +46 -0
  18. package/dist/astro-stat-grid/index.ts +1 -0
  19. package/dist/audience-feature-card/audience-feature-card.styles.ts +23 -0
  20. package/dist/audience-feature-card/audience-feature-card.ts +39 -0
  21. package/dist/audience-feature-card/index.ts +13 -0
  22. package/dist/brand-network-cell/brand-network-cell.styles.ts +46 -0
  23. package/dist/brand-network-cell/brand-network-cell.ts +35 -0
  24. package/dist/brand-network-cell/index.ts +14 -0
  25. package/dist/browser-chrome-mock/browser-chrome-mock.styles.ts +43 -0
  26. package/dist/browser-chrome-mock/browser-chrome-mock.ts +52 -0
  27. package/dist/browser-chrome-mock/index.ts +17 -0
  28. package/dist/index.ts +9 -0
  29. package/dist/marquee-strip/index.ts +14 -0
  30. package/dist/marquee-strip/marquee-strip.styles.ts +61 -0
  31. package/dist/marquee-strip/marquee-strip.ts +35 -0
  32. package/dist/mastery-bar/index.ts +15 -0
  33. package/dist/mastery-bar/mastery-bar.styles.ts +45 -0
  34. package/dist/mastery-bar/mastery-bar.ts +55 -0
  35. package/dist/numbered-steps/index.ts +16 -0
  36. package/dist/numbered-steps/numbered-steps.styles.ts +36 -0
  37. package/dist/numbered-steps/numbered-steps.ts +64 -0
  38. package/dist/pricing-card/index.ts +19 -0
  39. package/dist/pricing-card/pricing-card.styles.ts +71 -0
  40. package/dist/pricing-card/pricing-card.ts +37 -0
  41. package/dist/section-head/index.ts +13 -0
  42. package/dist/section-head/section-head.styles.ts +30 -0
  43. package/dist/section-head/section-head.ts +28 -0
  44. package/dist/stat-grid/index.ts +13 -0
  45. package/dist/stat-grid/stat-grid.styles.ts +25 -0
  46. package/dist/stat-grid/stat-grid.ts +41 -0
  47. package/package.json +10 -1
@@ -0,0 +1,71 @@
1
+ import { cva } from '../shared/index.ts'
2
+
3
+ /**
4
+ * Root pricing card container. The `featured` variant adds a primary-coloured
5
+ * ring to draw the eye to the recommended plan.
6
+ */
7
+ export const pricingCardVariants = cva({
8
+ base: [
9
+ 'relative flex flex-col rounded-2xl border border-border bg-card p-6',
10
+ 'transition-shadow',
11
+ ].join(' '),
12
+ variants: {
13
+ featured: {
14
+ true: 'ring-1 ring-primary',
15
+ false: '',
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ featured: 'false',
20
+ },
21
+ })
22
+
23
+ /** "Best value" / "Most popular" badge above the plan name. */
24
+ export const pricingCardBadgeClass =
25
+ 'mb-3 inline-flex items-center rounded-full bg-primary/10 px-2.5 py-0.5 text-xs font-medium text-primary'
26
+
27
+ /** Plan name (e.g. "Pro", "Starter"). */
28
+ export const pricingCardNameClass = 'text-lg font-bold text-foreground'
29
+
30
+ /** Main price figure (e.g. "$29", "Free"). */
31
+ export const pricingCardPriceClass = 'text-3xl font-bold text-foreground'
32
+
33
+ /** Billing period or qualifier (e.g. "/ month", "forever"). */
34
+ export const pricingCardPeriodClass = 'text-sm text-muted-foreground'
35
+
36
+ /** Short marketing description beneath the price. */
37
+ export const pricingCardDescriptionClass = 'text-sm text-muted-foreground'
38
+
39
+ /** Unordered list of included features. */
40
+ export const pricingCardFeatureListClass = 'flex flex-col gap-2'
41
+
42
+ /** A single feature row — tick icon + text. */
43
+ export const pricingCardFeatureRowClass = 'flex items-start gap-2 text-sm text-foreground'
44
+
45
+ /** Inline check SVG rendered before each feature string. */
46
+ export const pricingCardFeatureTickClass = 'mt-0.5 size-4 shrink-0 text-primary'
47
+
48
+ /**
49
+ * CTA button/link that appears at the bottom of the card.
50
+ *
51
+ * `default` — filled primary style (call to action on featured plans).
52
+ * `outline` — bordered secondary style (for non-featured plans).
53
+ */
54
+ export const pricingCtaVariants = cva({
55
+ base: [
56
+ 'mt-auto inline-flex w-full items-center justify-center rounded-lg px-4 py-2',
57
+ 'text-sm font-medium transition-colors',
58
+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2',
59
+ 'disabled:pointer-events-none disabled:opacity-50',
60
+ ].join(' '),
61
+ variants: {
62
+ variant: {
63
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90',
64
+ outline:
65
+ 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
66
+ },
67
+ },
68
+ defaultVariants: {
69
+ variant: 'default',
70
+ },
71
+ })
@@ -0,0 +1,37 @@
1
+ import type { AccessibilityProps } from '../shared/index.ts'
2
+
3
+ /** CTA button/link visual variant. */
4
+ export type PricingCtaVariant = 'default' | 'outline'
5
+
6
+ export interface PricingCardOptions {
7
+ /** Whether this card is highlighted as the featured / recommended plan. */
8
+ featured?: boolean
9
+ }
10
+
11
+ export interface PricingCardAPI {
12
+ /** ARIA props to spread on the card container. */
13
+ ariaProps: Partial<AccessibilityProps>
14
+ /** Data attributes for styling hooks and CSS selectors. */
15
+ dataAttributes: Record<string, string>
16
+ }
17
+
18
+ /**
19
+ * Build the framework-agnostic props for a pricing plan card.
20
+ *
21
+ * Returns `role="group"` (semantically groups the plan's content without
22
+ * imposing listitem semantics on a standalone card) and a `data-featured`
23
+ * attribute that adapters can use for conditional ring/highlight styling.
24
+ */
25
+ export function createPricingCard(options: PricingCardOptions = {}): PricingCardAPI {
26
+ const { featured = false } = options
27
+
28
+ const ariaProps: Partial<AccessibilityProps> = {
29
+ role: 'group',
30
+ }
31
+
32
+ const dataAttributes: Record<string, string> = {
33
+ 'data-featured': String(featured),
34
+ }
35
+
36
+ return { ariaProps, dataAttributes }
37
+ }
@@ -0,0 +1,13 @@
1
+ export {
2
+ createSectionHead,
3
+ type SectionHeadAlign,
4
+ type SectionHeadProps,
5
+ type SectionHeadAPI,
6
+ } from './section-head.js'
7
+
8
+ export {
9
+ sectionHeadVariants,
10
+ sectionHeadKickerClass,
11
+ sectionHeadTitleClass,
12
+ sectionHeadLedeClass,
13
+ } from './section-head.styles.js'
@@ -0,0 +1,30 @@
1
+ import { cva } from '../shared/index.ts'
2
+
3
+ /**
4
+ * Container variant that controls the alignment of the whole cluster.
5
+ * Center: auto-margins + text-center + constrained max-width for comfortable
6
+ * line length. Left: no margin constraint, flush left.
7
+ */
8
+ export const sectionHeadVariants = cva({
9
+ base: 'flex flex-col',
10
+ variants: {
11
+ align: {
12
+ center: 'mx-auto text-center max-w-2xl',
13
+ left: 'text-left',
14
+ },
15
+ },
16
+ defaultVariants: {
17
+ align: 'center',
18
+ },
19
+ })
20
+
21
+ /** Small-caps eyebrow label above the title. */
22
+ export const sectionHeadKickerClass =
23
+ 'text-[11px] uppercase tracking-widest text-primary font-semibold'
24
+
25
+ /** Primary h2 heading. */
26
+ export const sectionHeadTitleClass =
27
+ 'text-3xl sm:text-4xl font-bold tracking-tight text-foreground'
28
+
29
+ /** Optional lede paragraph below the title. */
30
+ export const sectionHeadLedeClass = 'mt-3 text-muted-foreground leading-relaxed'
@@ -0,0 +1,28 @@
1
+ /** Horizontal alignment of the section head cluster. */
2
+ export type SectionHeadAlign = 'center' | 'left'
3
+
4
+ export interface SectionHeadProps {
5
+ /** Alignment of the kicker, title, and lede. */
6
+ align?: SectionHeadAlign
7
+ }
8
+
9
+ export interface SectionHeadAPI {
10
+ /** Data attributes for styling hooks. */
11
+ dataAttributes: Record<string, string>
12
+ }
13
+
14
+ /**
15
+ * Build the framework-agnostic data attributes for a SectionHead.
16
+ *
17
+ * Returns data-align so adapters can apply styles via CSS or Tailwind
18
+ * variants. All visual logic (classes, cva) lives in `section-head.styles.ts`.
19
+ */
20
+ export function createSectionHead(props: SectionHeadProps = {}): SectionHeadAPI {
21
+ const { align = 'center' } = props
22
+
23
+ const dataAttributes: Record<string, string> = {
24
+ 'data-align': align,
25
+ }
26
+
27
+ return { dataAttributes }
28
+ }
@@ -0,0 +1,13 @@
1
+ export {
2
+ createStatGrid,
3
+ statColumns,
4
+ type StatItem,
5
+ type StatGridAPI,
6
+ } from './stat-grid.js'
7
+
8
+ export {
9
+ statGridVariants,
10
+ statItemClass,
11
+ statValueClass,
12
+ statLabelClass,
13
+ } from './stat-grid.styles.js'
@@ -0,0 +1,25 @@
1
+ import { cva } from '../shared/index.ts'
2
+
3
+ /** Grid container that lays out stat items. */
4
+ export const statGridVariants = cva({
5
+ base: 'grid gap-8',
6
+ variants: {
7
+ columns: {
8
+ '1': 'grid-cols-1',
9
+ '2': 'grid-cols-2',
10
+ '3': 'grid-cols-3',
11
+ },
12
+ },
13
+ defaultVariants: {
14
+ columns: '3',
15
+ },
16
+ })
17
+
18
+ /** Individual stat item container (role="listitem"). */
19
+ export const statItemClass = 'flex flex-col'
20
+
21
+ /** The large bold value of the stat. */
22
+ export const statValueClass = 'text-xl sm:text-2xl font-bold text-primary'
23
+
24
+ /** The descriptive label below the value. */
25
+ export const statLabelClass = 'mt-1 text-sm text-muted-foreground leading-snug'
@@ -0,0 +1,41 @@
1
+ /** A single stat callout displayed in the grid. */
2
+ export type StatItem = {
3
+ /** The primary value displayed prominently (e.g. "10k+", "$4.2M"). */
4
+ value: string
5
+ /** The descriptive label shown below the value. */
6
+ label: string
7
+ }
8
+
9
+ export interface StatGridAPI {
10
+ /** ARIA attributes to spread on the grid container element (`role="list"`). */
11
+ ariaProps: { role: 'list' }
12
+ /** Data attributes for styling hooks. */
13
+ dataAttributes: Record<string, string>
14
+ }
15
+
16
+ /**
17
+ * Compute the number of grid columns for a stat grid.
18
+ *
19
+ * - 1 item → 1 column
20
+ * - 2 items → 2 columns
21
+ * - 3 or more items → capped at `max` (default 3)
22
+ */
23
+ export function statColumns(count: number, max = 3): number {
24
+ if (count <= 0) return 1
25
+ if (count === 1) return 1
26
+ if (count === 2) return 2
27
+ return Math.min(count, max)
28
+ }
29
+
30
+ /**
31
+ * Build the framework-agnostic container props for a stat grid.
32
+ *
33
+ * Returns `role="list"` and data attributes; adapters spread these onto their
34
+ * container element and render the items themselves.
35
+ */
36
+ export function createStatGrid(): StatGridAPI {
37
+ return {
38
+ ariaProps: { role: 'list' },
39
+ dataAttributes: {},
40
+ }
41
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@refraction-ui/astro",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "All Refraction UI Astro components in one package",
5
5
  "type": "module",
6
6
  "exports": {
@@ -25,13 +25,16 @@
25
25
  "@refraction-ui/astro-analytics": "workspace:*",
26
26
  "@refraction-ui/astro-animated-text": "workspace:*",
27
27
  "@refraction-ui/astro-app-shell": "workspace:*",
28
+ "@refraction-ui/astro-audience-feature-card": "workspace:*",
28
29
  "@refraction-ui/astro-audio-room": "workspace:*",
29
30
  "@refraction-ui/astro-auth": "workspace:*",
30
31
  "@refraction-ui/astro-avatar": "workspace:*",
31
32
  "@refraction-ui/astro-avatar-group": "workspace:*",
32
33
  "@refraction-ui/astro-badge": "workspace:*",
33
34
  "@refraction-ui/astro-bottom-nav": "workspace:*",
35
+ "@refraction-ui/astro-brand-network-cell": "workspace:*",
34
36
  "@refraction-ui/astro-breadcrumbs": "workspace:*",
37
+ "@refraction-ui/astro-browser-chrome-mock": "workspace:*",
35
38
  "@refraction-ui/astro-button": "workspace:*",
36
39
  "@refraction-ui/astro-calendar": "workspace:*",
37
40
  "@refraction-ui/astro-call-controls": "workspace:*",
@@ -81,9 +84,12 @@
81
84
  "@refraction-ui/astro-live-transcript": "workspace:*",
82
85
  "@refraction-ui/astro-logger": "workspace:*",
83
86
  "@refraction-ui/astro-markdown-renderer": "workspace:*",
87
+ "@refraction-ui/astro-marquee-strip": "workspace:*",
88
+ "@refraction-ui/astro-mastery-bar": "workspace:*",
84
89
  "@refraction-ui/astro-mini-map": "workspace:*",
85
90
  "@refraction-ui/astro-mobile-nav": "workspace:*",
86
91
  "@refraction-ui/astro-navbar": "workspace:*",
92
+ "@refraction-ui/astro-numbered-steps": "workspace:*",
87
93
  "@refraction-ui/astro-otp-input": "workspace:*",
88
94
  "@refraction-ui/astro-pagination": "workspace:*",
89
95
  "@refraction-ui/astro-password-input": "workspace:*",
@@ -91,6 +97,7 @@
91
97
  "@refraction-ui/astro-popover": "workspace:*",
92
98
  "@refraction-ui/astro-pre-call-lobby": "workspace:*",
93
99
  "@refraction-ui/astro-presence-indicator": "workspace:*",
100
+ "@refraction-ui/astro-pricing-card": "workspace:*",
94
101
  "@refraction-ui/astro-progress-display": "workspace:*",
95
102
  "@refraction-ui/astro-radial-gauge": "workspace:*",
96
103
  "@refraction-ui/astro-radio": "workspace:*",
@@ -99,6 +106,7 @@
99
106
  "@refraction-ui/astro-resizable-layout": "workspace:*",
100
107
  "@refraction-ui/astro-rich-editor": "workspace:*",
101
108
  "@refraction-ui/astro-search-bar": "workspace:*",
109
+ "@refraction-ui/astro-section-head": "workspace:*",
102
110
  "@refraction-ui/astro-segmented-control": "workspace:*",
103
111
  "@refraction-ui/astro-select": "workspace:*",
104
112
  "@refraction-ui/astro-separator": "workspace:*",
@@ -108,6 +116,7 @@
108
116
  "@refraction-ui/astro-slide-viewer": "workspace:*",
109
117
  "@refraction-ui/astro-slider": "workspace:*",
110
118
  "@refraction-ui/astro-social-auth-button": "workspace:*",
119
+ "@refraction-ui/astro-stat-grid": "workspace:*",
111
120
  "@refraction-ui/astro-status-indicator": "workspace:*",
112
121
  "@refraction-ui/astro-steps": "workspace:*",
113
122
  "@refraction-ui/astro-sticky-note": "workspace:*",