@ankhorage/zora 1.0.6 → 1.0.8
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/CHANGELOG.md +12 -0
- package/README.md +183 -0
- package/dist/components/media-card/MediaCard.d.ts +4 -0
- package/dist/components/media-card/MediaCard.d.ts.map +1 -0
- package/dist/components/media-card/MediaCard.js +64 -0
- package/dist/components/media-card/MediaCard.js.map +1 -0
- package/dist/components/media-card/index.d.ts +3 -0
- package/dist/components/media-card/index.d.ts.map +1 -0
- package/dist/components/media-card/index.js +2 -0
- package/dist/components/media-card/index.js.map +1 -0
- package/dist/components/media-card/types.d.ts +36 -0
- package/dist/components/media-card/types.d.ts.map +1 -0
- package/dist/components/media-card/types.js +2 -0
- package/dist/components/media-card/types.js.map +1 -0
- package/dist/components/metric-card/MetricCard.d.ts +4 -0
- package/dist/components/metric-card/MetricCard.d.ts.map +1 -0
- package/dist/components/metric-card/MetricCard.js +43 -0
- package/dist/components/metric-card/MetricCard.js.map +1 -0
- package/dist/components/metric-card/index.d.ts +3 -0
- package/dist/components/metric-card/index.d.ts.map +1 -0
- package/dist/components/metric-card/index.js +2 -0
- package/dist/components/metric-card/index.js.map +1 -0
- package/dist/components/metric-card/types.d.ts +17 -0
- package/dist/components/metric-card/types.d.ts.map +1 -0
- package/dist/components/metric-card/types.js +2 -0
- package/dist/components/metric-card/types.js.map +1 -0
- package/dist/components/progress/Progress.d.ts +4 -0
- package/dist/components/progress/Progress.d.ts.map +1 -0
- package/dist/components/progress/Progress.js +28 -0
- package/dist/components/progress/Progress.js.map +1 -0
- package/dist/components/progress/index.d.ts +3 -0
- package/dist/components/progress/index.d.ts.map +1 -0
- package/dist/components/progress/index.js +2 -0
- package/dist/components/progress/index.js.map +1 -0
- package/dist/components/progress/resolveProgressFraction.d.ts +5 -0
- package/dist/components/progress/resolveProgressFraction.d.ts.map +1 -0
- package/dist/components/progress/resolveProgressFraction.js +14 -0
- package/dist/components/progress/resolveProgressFraction.js.map +1 -0
- package/dist/components/progress/types.d.ts +11 -0
- package/dist/components/progress/types.d.ts.map +1 -0
- package/dist/components/progress/types.js +16 -0
- package/dist/components/progress/types.js.map +1 -0
- package/dist/components/rating/Rating.d.ts +4 -0
- package/dist/components/rating/Rating.d.ts.map +1 -0
- package/dist/components/rating/Rating.js +23 -0
- package/dist/components/rating/Rating.js.map +1 -0
- package/dist/components/rating/index.d.ts +3 -0
- package/dist/components/rating/index.d.ts.map +1 -0
- package/dist/components/rating/index.js +2 -0
- package/dist/components/rating/index.js.map +1 -0
- package/dist/components/rating/resolveRatingSegments.d.ts +7 -0
- package/dist/components/rating/resolveRatingSegments.d.ts.map +1 -0
- package/dist/components/rating/resolveRatingSegments.js +22 -0
- package/dist/components/rating/resolveRatingSegments.js.map +1 -0
- package/dist/components/rating/types.d.ts +11 -0
- package/dist/components/rating/types.d.ts.map +1 -0
- package/dist/components/rating/types.js +16 -0
- package/dist/components/rating/types.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/patterns/timeline/Timeline.d.ts +4 -0
- package/dist/patterns/timeline/Timeline.d.ts.map +1 -0
- package/dist/patterns/timeline/Timeline.js +59 -0
- package/dist/patterns/timeline/Timeline.js.map +1 -0
- package/dist/patterns/timeline/index.d.ts +3 -0
- package/dist/patterns/timeline/index.d.ts.map +1 -0
- package/dist/patterns/timeline/index.js +2 -0
- package/dist/patterns/timeline/index.js.map +1 -0
- package/dist/patterns/timeline/types.d.ts +18 -0
- package/dist/patterns/timeline/types.d.ts.map +1 -0
- package/dist/patterns/timeline/types.js +2 -0
- package/dist/patterns/timeline/types.js.map +1 -0
- package/package.json +3 -3
- package/src/components/media-card/MediaCard.tsx +120 -0
- package/src/components/media-card/index.ts +2 -0
- package/src/components/media-card/types.ts +44 -0
- package/src/components/metric-card/MetricCard.tsx +84 -0
- package/src/components/metric-card/index.ts +2 -0
- package/src/components/metric-card/types.ts +18 -0
- package/src/components/progress/Progress.tsx +50 -0
- package/src/components/progress/index.ts +2 -0
- package/src/components/progress/resolveProgressFraction.test.ts +23 -0
- package/src/components/progress/resolveProgressFraction.ts +17 -0
- package/src/components/progress/types.ts +27 -0
- package/src/components/rating/Rating.tsx +38 -0
- package/src/components/rating/index.ts +2 -0
- package/src/components/rating/resolveRatingSegments.test.ts +60 -0
- package/src/components/rating/resolveRatingSegments.ts +34 -0
- package/src/components/rating/types.ts +27 -0
- package/src/index.ts +10 -0
- package/src/patterns/timeline/Timeline.tsx +104 -0
- package/src/patterns/timeline/index.ts +2 -0
- package/src/patterns/timeline/types.ts +20 -0
- package/src/showcaseCoverage.test.ts +5 -0
- package/src/theme/themeScopeStructure.test.ts +10 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/progress/types.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,mBAAmB,CAAC,KAAmB,EAAE,IAAc;IACrE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS,CAAC;QACf;YACE,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';\n\nimport type { ZoraControlSize, ZoraTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface ProgressProps extends ZoraBaseProps {\n value: number;\n max?: number;\n tone?: ZoraTone;\n size?: ZoraControlSize;\n}\n\nexport function resolveProgressRole(theme: SurfaceTheme, tone: ZoraTone): RoleSemantics {\n switch (tone) {\n case 'primary':\n return theme.semantics.action.primary;\n case 'danger':\n return theme.semantics.action.danger;\n case 'success':\n return theme.semantics.success;\n case 'warning':\n return theme.semantics.warning;\n case 'neutral':\n default:\n return theme.semantics.action.neutral;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/components/rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,SAAS,CAAC;AA6B9D,eAAO,MAAM,MAAM,mDAAkC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Inline } from '../../foundation';
|
|
3
|
+
import { resolveIconSize } from '../../internal/recipes';
|
|
4
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
5
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
6
|
+
import { Icon } from '../icon';
|
|
7
|
+
import { resolveRatingSegments } from './resolveRatingSegments';
|
|
8
|
+
import { resolveRatingRole } from './types';
|
|
9
|
+
function RatingInner({ themeId: _themeId, mode: _mode, testID, value, max = 5, tone = 'warning', size = 'm', }) {
|
|
10
|
+
const { theme } = useZoraTheme();
|
|
11
|
+
const role = resolveRatingRole(theme, tone);
|
|
12
|
+
const segments = resolveRatingSegments({ value, max });
|
|
13
|
+
const iconSize = resolveIconSize(size);
|
|
14
|
+
return (<Inline align="center" gap="xxs" testID={testID} wrap="nowrap">
|
|
15
|
+
{segments.map((segment, index) => {
|
|
16
|
+
const name = segment === 'full' ? 'star' : segment === 'half' ? 'star-half' : 'star-outline';
|
|
17
|
+
const color = segment === 'empty' ? theme.semantics.content.muted : role.base;
|
|
18
|
+
return <Icon key={index} color={color} name={name} size={iconSize}/>;
|
|
19
|
+
})}
|
|
20
|
+
</Inline>);
|
|
21
|
+
}
|
|
22
|
+
export const Rating = withZoraThemeScope(RatingInner);
|
|
23
|
+
//# sourceMappingURL=Rating.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.js","sourceRoot":"","sources":["../../../src/components/rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAoB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE9D,SAAS,WAAW,CAAC,EACnB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,MAAM,EACN,KAAK,EACL,GAAG,GAAG,CAAC,EACP,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,GAAG,GACE;IACZ,MAAM,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAEvC,OAAO,CACL,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAQ,CAC5D;MAAA,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;YAC/B,MAAM,IAAI,GACR,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC;YAClF,MAAM,KAAK,GAAG,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAE9E,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC;QACxE,CAAC,CAAC,CACJ;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport { Inline } from '../../foundation';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport { Icon } from '../icon';\nimport { resolveRatingSegments } from './resolveRatingSegments';\nimport { type RatingProps, resolveRatingRole } from './types';\n\nfunction RatingInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n value,\n max = 5,\n tone = 'warning',\n size = 'm',\n}: RatingProps) {\n const { theme } = useZoraTheme();\n const role = resolveRatingRole(theme, tone);\n const segments = resolveRatingSegments({ value, max });\n const iconSize = resolveIconSize(size);\n\n return (\n <Inline align=\"center\" gap=\"xxs\" testID={testID} wrap=\"nowrap\">\n {segments.map((segment, index) => {\n const name =\n segment === 'full' ? 'star' : segment === 'half' ? 'star-half' : 'star-outline';\n const color = segment === 'empty' ? theme.semantics.content.muted : role.base;\n\n return <Icon key={index} color={color} name={name} size={iconSize} />;\n })}\n </Inline>\n );\n}\n\nexport const Rating = withZoraThemeScope(RatingInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/rating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/rating/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { Rating } from './Rating';\nexport type { RatingProps } from './types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRatingSegments.d.ts","sourceRoot":"","sources":["../../../src/components/rating/resolveRatingSegments.ts"],"names":[],"mappings":"AAAA,KAAK,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAE/C,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,GAAG,GACJ,EAAE;IACD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,aAAa,EAAE,CAyBlB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function resolveRatingSegments({ value, max, }) {
|
|
2
|
+
if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
const clamped = Math.max(0, Math.min(value, max));
|
|
6
|
+
const halfSteps = Math.round(clamped * 2);
|
|
7
|
+
const segments = [];
|
|
8
|
+
for (let index = 0; index < max; index += 1) {
|
|
9
|
+
const threshold = (index + 1) * 2;
|
|
10
|
+
if (halfSteps >= threshold) {
|
|
11
|
+
segments.push('full');
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
if (halfSteps === threshold - 1) {
|
|
15
|
+
segments.push('half');
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
segments.push('empty');
|
|
19
|
+
}
|
|
20
|
+
return segments;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=resolveRatingSegments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRatingSegments.js","sourceRoot":"","sources":["../../../src/components/rating/resolveRatingSegments.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,qBAAqB,CAAC,EACpC,KAAK,EACL,GAAG,GAIJ;IACC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;QACjE,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC;IAC1C,MAAM,QAAQ,GAAoB,EAAE,CAAC;IAErC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5C,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAClC,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;YAC3B,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,GAAG,CAAC,EAAE,CAAC;YAChC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtB,SAAS;QACX,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["type RatingSegment = 'full' | 'half' | 'empty';\n\nexport function resolveRatingSegments({\n value,\n max,\n}: {\n value: number;\n max: number;\n}): RatingSegment[] {\n if (!Number.isFinite(value) || !Number.isFinite(max) || max <= 0) {\n return [];\n }\n\n const clamped = Math.max(0, Math.min(value, max));\n const halfSteps = Math.round(clamped * 2);\n const segments: RatingSegment[] = [];\n\n for (let index = 0; index < max; index += 1) {\n const threshold = (index + 1) * 2;\n if (halfSteps >= threshold) {\n segments.push('full');\n continue;\n }\n\n if (halfSteps === threshold - 1) {\n segments.push('half');\n continue;\n }\n\n segments.push('empty');\n }\n\n return segments;\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';
|
|
2
|
+
import type { ZoraControlSize, ZoraTone } from '../../internal/recipes';
|
|
3
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
4
|
+
export interface RatingProps extends ZoraBaseProps {
|
|
5
|
+
value: number;
|
|
6
|
+
max?: number;
|
|
7
|
+
tone?: ZoraTone;
|
|
8
|
+
size?: ZoraControlSize;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveRatingRole(theme: SurfaceTheme, tone: ZoraTone): RoleSemantics;
|
|
11
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/rating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,GAAG,aAAa,CAcpF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function resolveRatingRole(theme, tone) {
|
|
2
|
+
switch (tone) {
|
|
3
|
+
case 'primary':
|
|
4
|
+
return theme.semantics.action.primary;
|
|
5
|
+
case 'danger':
|
|
6
|
+
return theme.semantics.action.danger;
|
|
7
|
+
case 'success':
|
|
8
|
+
return theme.semantics.success;
|
|
9
|
+
case 'warning':
|
|
10
|
+
return theme.semantics.warning;
|
|
11
|
+
case 'neutral':
|
|
12
|
+
default:
|
|
13
|
+
return theme.semantics.action.neutral;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/rating/types.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,iBAAiB,CAAC,KAAmB,EAAE,IAAc;IACnE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS,CAAC;QACf;YACE,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;IAC1C,CAAC;AACH,CAAC","sourcesContent":["import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';\n\nimport type { ZoraControlSize, ZoraTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface RatingProps extends ZoraBaseProps {\n value: number;\n max?: number;\n tone?: ZoraTone;\n size?: ZoraControlSize;\n}\n\nexport function resolveRatingRole(theme: SurfaceTheme, tone: ZoraTone): RoleSemantics {\n switch (tone) {\n case 'primary':\n return theme.semantics.action.primary;\n case 'danger':\n return theme.semantics.action.danger;\n case 'success':\n return theme.semantics.success;\n case 'warning':\n return theme.semantics.warning;\n case 'neutral':\n default:\n return theme.semantics.action.neutral;\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -26,10 +26,18 @@ export type { IconButtonProps } from './components/icon-button';
|
|
|
26
26
|
export { IconButton } from './components/icon-button';
|
|
27
27
|
export type { InputProps, InputTrailingAction } from './components/input';
|
|
28
28
|
export { Input } from './components/input';
|
|
29
|
+
export type { MediaCardImageProps, MediaCardProps } from './components/media-card';
|
|
30
|
+
export { MediaCard } from './components/media-card';
|
|
31
|
+
export type { MetricCardProps } from './components/metric-card';
|
|
32
|
+
export { MetricCard } from './components/metric-card';
|
|
29
33
|
export type { ModalProps } from './components/modal';
|
|
30
34
|
export { Modal } from './components/modal';
|
|
35
|
+
export type { ProgressProps } from './components/progress';
|
|
36
|
+
export { Progress } from './components/progress';
|
|
31
37
|
export type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';
|
|
32
38
|
export { Radio, RadioGroup } from './components/radio';
|
|
39
|
+
export type { RatingProps } from './components/rating';
|
|
40
|
+
export { Rating } from './components/rating';
|
|
33
41
|
export type { SearchBarProps } from './components/search-bar';
|
|
34
42
|
export { SearchBar } from './components/search-bar';
|
|
35
43
|
export type { SelectOption, SelectProps } from './components/select';
|
|
@@ -92,6 +100,8 @@ export type { ThemeComposerProps } from './patterns/theme-composer';
|
|
|
92
100
|
export { ThemeComposer } from './patterns/theme-composer';
|
|
93
101
|
export type { PaletteItemProps, TileGridProps } from './patterns/tile-grid';
|
|
94
102
|
export { PaletteItem, TileGrid } from './patterns/tile-grid';
|
|
103
|
+
export type { TimelineItem, TimelineProps } from './patterns/timeline';
|
|
104
|
+
export { Timeline } from './patterns/timeline';
|
|
95
105
|
export type { TreeItemNode, TreeItemRenderProps, TreeViewProps } from './patterns/tree-view';
|
|
96
106
|
export { TreeItem, TreeView } from './patterns/tree-view';
|
|
97
107
|
export * from './theme';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACpE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACpG,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,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CAAC;AACzC,YAAY,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,12 @@ export { Heading } from './components/heading';
|
|
|
12
12
|
export { Icon } from './components/icon';
|
|
13
13
|
export { IconButton } from './components/icon-button';
|
|
14
14
|
export { Input } from './components/input';
|
|
15
|
+
export { MediaCard } from './components/media-card';
|
|
16
|
+
export { MetricCard } from './components/metric-card';
|
|
15
17
|
export { Modal } from './components/modal';
|
|
18
|
+
export { Progress } from './components/progress';
|
|
16
19
|
export { Radio, RadioGroup } from './components/radio';
|
|
20
|
+
export { Rating } from './components/rating';
|
|
17
21
|
export { SearchBar } from './components/search-bar';
|
|
18
22
|
export { Select } from './components/select';
|
|
19
23
|
export { Tabs } from './components/tabs';
|
|
@@ -45,6 +49,7 @@ export { SettingsRow } from './patterns/settings-row';
|
|
|
45
49
|
export { SwitchField } from './patterns/switch-field';
|
|
46
50
|
export { ThemeComposer } from './patterns/theme-composer';
|
|
47
51
|
export { PaletteItem, TileGrid } from './patterns/tile-grid';
|
|
52
|
+
export { Timeline } from './patterns/timeline';
|
|
48
53
|
export { TreeItem, TreeView } from './patterns/tree-view';
|
|
49
54
|
export * from './theme';
|
|
50
55
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAmB7C,OAAO,EACL,IAAI,EACJ,WAAW,EACX,SAAS,EACT,SAAS,EACT,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,aAAa,GACd,MAAM,mBAAmB,CAAC;AAS3B,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAs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BAAiB,CAAC;AAKtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS5D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,SAAS,CAAC","sourcesContent":["export type { AvatarProps, AvatarShape, AvatarSize } from './components/avatar';\nexport { Avatar, resolveAvatarInitials } from './components/avatar';\nexport type { AvatarGroupItem, AvatarGroupProps } from './components/avatar-group';\nexport { AvatarGroup } from './components/avatar-group';\nexport type { BadgeProps } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { ButtonProps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './components/checkbox';\nexport { Checkbox, CheckboxGroup } from './components/checkbox';\nexport type { ChipProps } from './components/chip';\nexport { Chip } from './components/chip';\nexport type { ChipGroupItem, ChipGroupProps } from './components/chip-group';\nexport { ChipGroup } from './components/chip-group';\nexport type { DrawerProps } from './components/drawer';\nexport { Drawer } from './components/drawer';\nexport type {\n FormActionsProps,\n FormErrorProps,\n FormErrors,\n FormFieldConfig,\n FormFieldControlProps,\n FormFieldInputType,\n FormFieldProps,\n FormFieldValue,\n FormFieldWrapperProps,\n FormProps,\n FormValidationErrors,\n FormValidationResult,\n FormValues,\n UseFormControllerOptions,\n UseFormControllerResult,\n ValidationRule,\n} from './components/form';\nexport {\n Form,\n FormActions,\n FormError,\n FormField,\n hasRequiredRule,\n useFormController,\n validateField,\n validateFields,\n validateValue,\n} from './components/form';\nexport type {\n HeadingAlign,\n HeadingLevel,\n HeadingProps,\n HeadingSize,\n HeadingTone,\n HeadingWeight,\n} from './components/heading';\nexport { Heading } from './components/heading';\nexport type { IconProps } from './components/icon';\nexport { Icon } from './components/icon';\nexport type { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { InputProps, InputTrailingAction } from './components/input';\nexport { Input } from './components/input';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';\nexport { Radio, RadioGroup } from './components/radio';\nexport type { SearchBarProps } from './components/search-bar';\nexport { SearchBar } from './components/search-bar';\nexport type { SelectOption, SelectProps } from './components/select';\nexport { Select } from './components/select';\nexport type { TabItem, TabsProps } from './components/tabs';\nexport { Tabs } from './components/tabs';\nexport type { TextAlign, TextProps, TextTone, TextVariant, TextWeight } from './components/text';\nexport { Text } from './components/text';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToolbarActionProps, ToolbarProps } from './components/toolbar';\nexport { Toolbar, ToolbarAction } from './components/toolbar';\nexport type {\n BoxProps,\n CenterProps,\n ContainerProps,\n DividerProps,\n GridProps,\n InlineProps,\n ShowProps,\n SpacerProps,\n StackProps,\n SurfaceProps,\n SurfaceVariant,\n} from './foundation';\nexport {\n Box,\n Center,\n Container,\n Divider,\n Grid,\n Inline,\n Show,\n Spacer,\n Stack,\n Surface,\n} from './foundation';\nexport type { AppShellProps } from './layout/app-shell';\nexport { AppShell } from './layout/app-shell';\nexport type { AuthLayoutProps } from './layout/auth-layout';\nexport { AuthLayout } from './layout/auth-layout';\nexport type { PageProps } from './layout/page';\nexport { Page } from './layout/page';\nexport type { PageHeaderProps } from './layout/page-header';\nexport { PageHeader } from './layout/page-header';\nexport type { PageSectionProps } from './layout/page-section';\nexport { PageSection } from './layout/page-section';\nexport type { SettingsLayoutProps } from './layout/settings-layout';\nexport { SettingsLayout } from './layout/settings-layout';\nexport type { SidebarLayoutProps } from './layout/sidebar-layout';\nexport { SidebarLayout } from './layout/sidebar-layout';\nexport type { TopbarLayoutProps } from './layout/topbar-layout';\nexport { TopbarLayout } from './layout/topbar-layout';\nexport type {\n AuthFormBaseProps,\n AuthIdentifierKind,\n ForgotPasswordFormProps,\n ForgotPasswordFormValues,\n OtpFormProps,\n OtpFormValues,\n SignInFormProps,\n SignInFormValues,\n SignUpFormField,\n SignUpFormProps,\n SignUpFormValues,\n} from './patterns/auth';\nexport { ForgotPasswordForm, OtpForm, SignInForm, SignUpForm } from './patterns/auth';\nexport type {\n CollectionEditorProps,\n CollectionEditorRenderItemProps,\n} from './patterns/collection-editor';\nexport { CollectionEditor } from './patterns/collection-editor';\nexport type { ConfirmDialogProps } from './patterns/confirm-dialog';\nexport { ConfirmDialog } from './patterns/confirm-dialog';\nexport type { DisclosureSectionProps } from './patterns/disclosure-section';\nexport { DisclosureSection } from './patterns/disclosure-section';\nexport type { EmptyStateAction, EmptyStateProps } from './patterns/empty-state';\nexport { EmptyState } from './patterns/empty-state';\nexport type { FilterBarProps } from './patterns/filter-bar';\nexport { FilterBar } from './patterns/filter-bar';\nexport type { InspectorFieldProps } from './patterns/inspector-field';\nexport { InspectorField } from './patterns/inspector-field';\nexport type {\n ListChildrenProps,\n ListItemsProps,\n ListProps,\n ListRowProps,\n ListRowVariant,\n ListSectionProps,\n} from './patterns/list';\nexport { List, ListRow, ListSection } from './patterns/list';\nexport type { NoticeProps } from './patterns/notice';\nexport { Notice } from './patterns/notice';\nexport type { PanelProps } from './patterns/panel';\nexport { Panel } from './patterns/panel';\nexport type { ResponsivePanelProps } from './patterns/responsive-panel';\nexport { ResponsivePanel } from './patterns/responsive-panel';\nexport type { SectionHeaderProps } from './patterns/section-header';\nexport { SectionHeader } from './patterns/section-header';\nexport type { SettingsRowProps } from './patterns/settings-row';\nexport { SettingsRow } from './patterns/settings-row';\nexport type { SwitchFieldProps } from './patterns/switch-field';\nexport { SwitchField } from './patterns/switch-field';\nexport type { ThemeComposerProps } from './patterns/theme-composer';\nexport { ThemeComposer } from './patterns/theme-composer';\nexport type { PaletteItemProps, TileGridProps } from './patterns/tile-grid';\nexport { PaletteItem, TileGrid } from './patterns/tile-grid';\nexport type { TreeItemNode, TreeItemRenderProps, TreeViewProps } from './patterns/tree-view';\nexport { TreeItem, TreeView } from './patterns/tree-view';\nexport * from './theme';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAA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AA2B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC1D,cAAc,SAAS,CAAC","sourcesContent":["export type { AvatarProps, AvatarShape, AvatarSize } from './components/avatar';\nexport { Avatar, resolveAvatarInitials } from './components/avatar';\nexport type { AvatarGroupItem, AvatarGroupProps } from './components/avatar-group';\nexport { AvatarGroup } from './components/avatar-group';\nexport type { BadgeProps } from './components/badge';\nexport { Badge } from './components/badge';\nexport type { ButtonProps } from './components/button';\nexport { Button } from './components/button';\nexport type { CardProps } from './components/card';\nexport { Card } from './components/card';\nexport type { CheckboxGroupOption, CheckboxGroupProps, CheckboxProps } from './components/checkbox';\nexport { Checkbox, CheckboxGroup } from './components/checkbox';\nexport type { ChipProps } from './components/chip';\nexport { Chip } from './components/chip';\nexport type { ChipGroupItem, ChipGroupProps } from './components/chip-group';\nexport { ChipGroup } from './components/chip-group';\nexport type { DrawerProps } from './components/drawer';\nexport { Drawer } from './components/drawer';\nexport type {\n FormActionsProps,\n FormErrorProps,\n FormErrors,\n FormFieldConfig,\n FormFieldControlProps,\n FormFieldInputType,\n FormFieldProps,\n FormFieldValue,\n FormFieldWrapperProps,\n FormProps,\n FormValidationErrors,\n FormValidationResult,\n FormValues,\n UseFormControllerOptions,\n UseFormControllerResult,\n ValidationRule,\n} from './components/form';\nexport {\n Form,\n FormActions,\n FormError,\n FormField,\n hasRequiredRule,\n useFormController,\n validateField,\n validateFields,\n validateValue,\n} from './components/form';\nexport type {\n HeadingAlign,\n HeadingLevel,\n HeadingProps,\n HeadingSize,\n HeadingTone,\n HeadingWeight,\n} from './components/heading';\nexport { Heading } from './components/heading';\nexport type { IconProps } from './components/icon';\nexport { Icon } from './components/icon';\nexport type { IconButtonProps } from './components/icon-button';\nexport { IconButton } from './components/icon-button';\nexport type { InputProps, InputTrailingAction } from './components/input';\nexport { Input } from './components/input';\nexport type { MediaCardImageProps, MediaCardProps } from './components/media-card';\nexport { MediaCard } from './components/media-card';\nexport type { MetricCardProps } from './components/metric-card';\nexport { MetricCard } from './components/metric-card';\nexport type { ModalProps } from './components/modal';\nexport { Modal } from './components/modal';\nexport type { ProgressProps } from './components/progress';\nexport { Progress } from './components/progress';\nexport type { RadioGroupOption, RadioGroupProps, RadioProps } from './components/radio';\nexport { Radio, RadioGroup } from './components/radio';\nexport type { RatingProps } from './components/rating';\nexport { Rating } from './components/rating';\nexport type { SearchBarProps } from './components/search-bar';\nexport { SearchBar } from './components/search-bar';\nexport type { SelectOption, SelectProps } from './components/select';\nexport { Select } from './components/select';\nexport type { TabItem, TabsProps } from './components/tabs';\nexport { Tabs } from './components/tabs';\nexport type { TextAlign, TextProps, TextTone, TextVariant, TextWeight } from './components/text';\nexport { Text } from './components/text';\nexport type { TextareaProps } from './components/textarea';\nexport { Textarea } from './components/textarea';\nexport type { ToolbarActionProps, ToolbarProps } from './components/toolbar';\nexport { Toolbar, ToolbarAction } from './components/toolbar';\nexport type {\n BoxProps,\n CenterProps,\n ContainerProps,\n DividerProps,\n GridProps,\n InlineProps,\n ShowProps,\n SpacerProps,\n StackProps,\n SurfaceProps,\n SurfaceVariant,\n} from './foundation';\nexport {\n Box,\n Center,\n Container,\n Divider,\n Grid,\n Inline,\n Show,\n Spacer,\n Stack,\n Surface,\n} from './foundation';\nexport type { AppShellProps } from './layout/app-shell';\nexport { AppShell } from './layout/app-shell';\nexport type { AuthLayoutProps } from './layout/auth-layout';\nexport { AuthLayout } from './layout/auth-layout';\nexport type { PageProps } from './layout/page';\nexport { Page } from './layout/page';\nexport type { PageHeaderProps } from './layout/page-header';\nexport { PageHeader } from './layout/page-header';\nexport type { PageSectionProps } from './layout/page-section';\nexport { PageSection } from './layout/page-section';\nexport type { SettingsLayoutProps } from './layout/settings-layout';\nexport { SettingsLayout } from './layout/settings-layout';\nexport type { SidebarLayoutProps } from './layout/sidebar-layout';\nexport { SidebarLayout } from './layout/sidebar-layout';\nexport type { TopbarLayoutProps } from './layout/topbar-layout';\nexport { TopbarLayout } from './layout/topbar-layout';\nexport type {\n AuthFormBaseProps,\n AuthIdentifierKind,\n ForgotPasswordFormProps,\n ForgotPasswordFormValues,\n OtpFormProps,\n OtpFormValues,\n SignInFormProps,\n SignInFormValues,\n SignUpFormField,\n SignUpFormProps,\n SignUpFormValues,\n} from './patterns/auth';\nexport { ForgotPasswordForm, OtpForm, SignInForm, SignUpForm } from './patterns/auth';\nexport type {\n CollectionEditorProps,\n CollectionEditorRenderItemProps,\n} from './patterns/collection-editor';\nexport { CollectionEditor } from './patterns/collection-editor';\nexport type { ConfirmDialogProps } from './patterns/confirm-dialog';\nexport { ConfirmDialog } from './patterns/confirm-dialog';\nexport type { DisclosureSectionProps } from './patterns/disclosure-section';\nexport { DisclosureSection } from './patterns/disclosure-section';\nexport type { EmptyStateAction, EmptyStateProps } from './patterns/empty-state';\nexport { EmptyState } from './patterns/empty-state';\nexport type { FilterBarProps } from './patterns/filter-bar';\nexport { FilterBar } from './patterns/filter-bar';\nexport type { InspectorFieldProps } from './patterns/inspector-field';\nexport { InspectorField } from './patterns/inspector-field';\nexport type {\n ListChildrenProps,\n ListItemsProps,\n ListProps,\n ListRowProps,\n ListRowVariant,\n ListSectionProps,\n} from './patterns/list';\nexport { List, ListRow, ListSection } from './patterns/list';\nexport type { NoticeProps } from './patterns/notice';\nexport { Notice } from './patterns/notice';\nexport type { PanelProps } from './patterns/panel';\nexport { Panel } from './patterns/panel';\nexport type { ResponsivePanelProps } from './patterns/responsive-panel';\nexport { ResponsivePanel } from './patterns/responsive-panel';\nexport type { SectionHeaderProps } from './patterns/section-header';\nexport { SectionHeader } from './patterns/section-header';\nexport type { SettingsRowProps } from './patterns/settings-row';\nexport { SettingsRow } from './patterns/settings-row';\nexport type { SwitchFieldProps } from './patterns/switch-field';\nexport { SwitchField } from './patterns/switch-field';\nexport type { ThemeComposerProps } from './patterns/theme-composer';\nexport { ThemeComposer } from './patterns/theme-composer';\nexport type { PaletteItemProps, TileGridProps } from './patterns/tile-grid';\nexport { PaletteItem, TileGrid } from './patterns/tile-grid';\nexport type { TimelineItem, TimelineProps } from './patterns/timeline';\nexport { Timeline } from './patterns/timeline';\nexport type { TreeItemNode, TreeItemRenderProps, TreeViewProps } from './patterns/tree-view';\nexport { TreeItem, TreeView } from './patterns/tree-view';\nexport * from './theme';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../../src/patterns/timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AA4F3D,eAAO,MAAM,QAAQ,qDAAoC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Heading } from '../../components/heading';
|
|
3
|
+
import { Icon } from '../../components/icon';
|
|
4
|
+
import { Text } from '../../components/text';
|
|
5
|
+
import { Box, Inline, Stack } from '../../foundation';
|
|
6
|
+
import { resolveIconSize } from '../../internal/recipes';
|
|
7
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
8
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
9
|
+
function resolveRoleSemantics(theme, tone) {
|
|
10
|
+
switch (tone) {
|
|
11
|
+
case 'primary':
|
|
12
|
+
return theme.semantics.action.primary;
|
|
13
|
+
case 'danger':
|
|
14
|
+
return theme.semantics.action.danger;
|
|
15
|
+
case 'success':
|
|
16
|
+
return theme.semantics.success;
|
|
17
|
+
case 'warning':
|
|
18
|
+
return theme.semantics.warning;
|
|
19
|
+
case 'neutral':
|
|
20
|
+
default:
|
|
21
|
+
return theme.semantics.action.neutral;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function TimelineInner({ themeId: _themeId, mode: _mode, testID, items, compact = false, }) {
|
|
25
|
+
const { theme } = useZoraTheme();
|
|
26
|
+
const gap = compact ? 'm' : 'l';
|
|
27
|
+
const renderItem = (item, index) => {
|
|
28
|
+
const status = item.status ?? 'neutral';
|
|
29
|
+
const role = resolveRoleSemantics(theme, status);
|
|
30
|
+
const showConnector = index < items.length - 1;
|
|
31
|
+
const iconSize = Math.max(12, resolveIconSize('s'));
|
|
32
|
+
return (<Inline key={item.id} align="flex-start" gap="m" testID={item.testID} wrap="nowrap">
|
|
33
|
+
<Stack align="center" flexShrink={0} gap="xs" style={{ width: 24 }}>
|
|
34
|
+
<Box bg={status === 'neutral' ? theme.semantics.neutral.surface : role.softBg} borderColor={status === 'neutral' ? theme.semantics.neutral.divider : role.base} borderWidth={1} height={20} radius="full" width={20} style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
35
|
+
{item.icon ? (<Icon color={status === 'neutral' ? theme.semantics.content.muted : role.base} name={item.icon.name} provider={item.icon.provider} size={iconSize}/>) : null}
|
|
36
|
+
</Box>
|
|
37
|
+
|
|
38
|
+
{showConnector ? (<Box bg={theme.semantics.neutral.divider} flex={1} radius="full" style={{ minHeight: 16, width: 2 }}/>) : null}
|
|
39
|
+
</Stack>
|
|
40
|
+
|
|
41
|
+
<Stack flex={1} gap="xs" testID={testID}>
|
|
42
|
+
<Inline align="flex-start" gap="s" justify="space-between" wrap="wrap">
|
|
43
|
+
<Heading level={compact ? 4 : 3}>{item.title}</Heading>
|
|
44
|
+
{item.meta ? (<Text tone="muted" variant="caption">
|
|
45
|
+
{item.meta}
|
|
46
|
+
</Text>) : null}
|
|
47
|
+
</Inline>
|
|
48
|
+
{item.description ? (<Text tone="muted" variant="bodySmall">
|
|
49
|
+
{item.description}
|
|
50
|
+
</Text>) : null}
|
|
51
|
+
</Stack>
|
|
52
|
+
</Inline>);
|
|
53
|
+
};
|
|
54
|
+
return (<Stack gap={gap} testID={testID}>
|
|
55
|
+
{items.map(renderItem)}
|
|
56
|
+
</Stack>);
|
|
57
|
+
}
|
|
58
|
+
export const Timeline = withZoraThemeScope(TimelineInner);
|
|
59
|
+
//# sourceMappingURL=Timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../../src/patterns/timeline/Timeline.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAGpE,SAAS,oBAAoB,CAAC,KAAmB,EAAE,IAAc;IAC/D,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;QACxC,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC;QACvC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,SAAS,CAAC,OAAO,CAAC;QACjC,KAAK,SAAS,CAAC;QACf;YACE,OAAO,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC;IAC1C,CAAC;AACH,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,OAAO,EAAE,QAAQ,EACjB,IAAI,EAAE,KAAK,EACX,MAAM,EACN,KA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AK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,OAAO,CACtD;YAAA,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACX,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,SAAS,CAClC;gBAAA,CAAC,IAAI,CAAC,IAAI,CACZ;cAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;UAAA,EAAE,MAAM,CACR;UAAA,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CACpC;cAAA,CAAC,IAAI,CAAC,WAAW,CACnB;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,IAAI,CACV;QAAA,EAAE,KAAK,CACT;MAAA,EAAE,MAAM,CAAC,CACV,CAAC;IACJ,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAC9B;MAAA,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CACxB;IAAA,EAAE,KAAK,CAAC,CACT,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,kBAAkB,CAAC,aAAa,CAAC,CAAC","sourcesContent":["import type { RoleSemantics, SurfaceTheme } from '@ankhorage/surface';\nimport React from 'react';\n\nimport { Heading } from '../../components/heading';\nimport { Icon } from '../../components/icon';\nimport { Text } from '../../components/text';\nimport { Box, Inline, Stack } from '../../foundation';\nimport type { ZoraTone } from '../../internal/recipes';\nimport { resolveIconSize } from '../../internal/recipes';\nimport { useZoraTheme } from '../../theme/useZoraTheme';\nimport { withZoraThemeScope } from '../../theme/withZoraThemeScope';\nimport type { TimelineItem, TimelineProps } from './types';\n\nfunction resolveRoleSemantics(theme: SurfaceTheme, tone: ZoraTone): RoleSemantics {\n switch (tone) {\n case 'primary':\n return theme.semantics.action.primary;\n case 'danger':\n return theme.semantics.action.danger;\n case 'success':\n return theme.semantics.success;\n case 'warning':\n return theme.semantics.warning;\n case 'neutral':\n default:\n return theme.semantics.action.neutral;\n }\n}\n\nfunction TimelineInner({\n themeId: _themeId,\n mode: _mode,\n testID,\n items,\n compact = false,\n}: TimelineProps) {\n const { theme } = useZoraTheme();\n const gap = compact ? 'm' : 'l';\n\n const renderItem = (item: TimelineItem, index: number) => {\n const status = item.status ?? 'neutral';\n const role = resolveRoleSemantics(theme, status);\n const showConnector = index < items.length - 1;\n const iconSize = Math.max(12, resolveIconSize('s'));\n\n return (\n <Inline key={item.id} align=\"flex-start\" gap=\"m\" testID={item.testID} wrap=\"nowrap\">\n <Stack align=\"center\" flexShrink={0} gap=\"xs\" style={{ width: 24 }}>\n <Box\n bg={status === 'neutral' ? theme.semantics.neutral.surface : role.softBg}\n borderColor={status === 'neutral' ? theme.semantics.neutral.divider : role.base}\n borderWidth={1}\n height={20}\n radius=\"full\"\n width={20}\n style={{ alignItems: 'center', justifyContent: 'center' }}\n >\n {item.icon ? (\n <Icon\n color={status === 'neutral' ? theme.semantics.content.muted : role.base}\n name={item.icon.name}\n provider={item.icon.provider}\n size={iconSize}\n />\n ) : null}\n </Box>\n\n {showConnector ? (\n <Box\n bg={theme.semantics.neutral.divider}\n flex={1}\n radius=\"full\"\n style={{ minHeight: 16, width: 2 }}\n />\n ) : null}\n </Stack>\n\n <Stack flex={1} gap=\"xs\" testID={testID}>\n <Inline align=\"flex-start\" gap=\"s\" justify=\"space-between\" wrap=\"wrap\">\n <Heading level={compact ? 4 : 3}>{item.title}</Heading>\n {item.meta ? (\n <Text tone=\"muted\" variant=\"caption\">\n {item.meta}\n </Text>\n ) : null}\n </Inline>\n {item.description ? (\n <Text tone=\"muted\" variant=\"bodySmall\">\n {item.description}\n </Text>\n ) : null}\n </Stack>\n </Inline>\n );\n };\n\n return (\n <Stack gap={gap} testID={testID}>\n {items.map(renderItem)}\n </Stack>\n );\n}\n\nexport const Timeline = withZoraThemeScope(TimelineInner);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/patterns/timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/timeline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["export { Timeline } from './Timeline';\nexport type { TimelineItem, TimelineProps } from './types';\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ButtonIconSpec } from '@ankhorage/surface';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
import type { ZoraTone } from '../../internal/recipes';
|
|
4
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
5
|
+
export interface TimelineItem {
|
|
6
|
+
id: string;
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
description?: React.ReactNode;
|
|
9
|
+
meta?: React.ReactNode;
|
|
10
|
+
status?: ZoraTone;
|
|
11
|
+
icon?: ButtonIconSpec;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TimelineProps extends ZoraBaseProps {
|
|
15
|
+
items: readonly TimelineItem[];
|
|
16
|
+
compact?: boolean;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/patterns/timeline/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAc,SAAQ,aAAa;IAClD,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/patterns/timeline/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ButtonIconSpec } from '@ankhorage/surface';\nimport type React from 'react';\n\nimport type { ZoraTone } from '../../internal/recipes';\nimport type { ZoraBaseProps } from '../../theme/ZoraBaseProps';\n\nexport interface TimelineItem {\n id: string;\n title: React.ReactNode;\n description?: React.ReactNode;\n meta?: React.ReactNode;\n status?: ZoraTone;\n icon?: ButtonIconSpec;\n testID?: string;\n}\n\nexport interface TimelineProps extends ZoraBaseProps {\n items: readonly TimelineItem[];\n compact?: boolean;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/zora",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.8",
|
|
5
5
|
"description": "Opinionated React Native and React Native Web UI kit built on @ankhorage/surface.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/zora#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@ankhorage/color-theory": "^0.0.
|
|
46
|
+
"@ankhorage/color-theory": "^0.0.4",
|
|
47
47
|
"@ankhorage/contracts": "^1.1.1",
|
|
48
|
-
"@ankhorage/surface": "^1.0.
|
|
48
|
+
"@ankhorage/surface": "^1.0.2"
|
|
49
49
|
},
|
|
50
50
|
"files": [
|
|
51
51
|
"dist",
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Box, Stack } from '../../foundation';
|
|
5
|
+
import { useZoraTheme } from '../../theme/useZoraTheme';
|
|
6
|
+
import { withZoraThemeScope } from '../../theme/withZoraThemeScope';
|
|
7
|
+
import { Card } from '../card';
|
|
8
|
+
import { Heading } from '../heading';
|
|
9
|
+
import { Text } from '../text';
|
|
10
|
+
import type { MediaCardProps } from './types';
|
|
11
|
+
|
|
12
|
+
function resolveImageAspectRatio(
|
|
13
|
+
imageAspectRatio: NonNullable<MediaCardProps['imageAspectRatio']>,
|
|
14
|
+
) {
|
|
15
|
+
if (!Number.isFinite(imageAspectRatio) || imageAspectRatio <= 0) {
|
|
16
|
+
return 16 / 9;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return imageAspectRatio;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function MediaCardInner({
|
|
23
|
+
themeId: _themeId,
|
|
24
|
+
mode: _mode,
|
|
25
|
+
testID,
|
|
26
|
+
imageSource,
|
|
27
|
+
imageLabel,
|
|
28
|
+
image,
|
|
29
|
+
imageAspectRatio = 16 / 9,
|
|
30
|
+
title,
|
|
31
|
+
description,
|
|
32
|
+
eyebrow,
|
|
33
|
+
badges,
|
|
34
|
+
actions,
|
|
35
|
+
footer,
|
|
36
|
+
children,
|
|
37
|
+
tone = 'default',
|
|
38
|
+
compact = false,
|
|
39
|
+
onPress,
|
|
40
|
+
}: MediaCardProps) {
|
|
41
|
+
const { theme } = useZoraTheme();
|
|
42
|
+
const gap = compact ? 's' : 'm';
|
|
43
|
+
const isInteractive = Boolean(onPress) && !actions;
|
|
44
|
+
const resolvedAspectRatio = resolveImageAspectRatio(imageAspectRatio);
|
|
45
|
+
|
|
46
|
+
const renderImage = () => {
|
|
47
|
+
if (image) {
|
|
48
|
+
return (
|
|
49
|
+
<Box radius="m" style={{ overflow: 'hidden' }}>
|
|
50
|
+
{image}
|
|
51
|
+
</Box>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!imageSource) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Box bg={theme.semantics.neutral.surface} radius="m" style={{ overflow: 'hidden' }}>
|
|
61
|
+
<Box style={{ aspectRatio: resolvedAspectRatio, width: '100%' }}>
|
|
62
|
+
<Image
|
|
63
|
+
accessibilityLabel={imageLabel}
|
|
64
|
+
source={imageSource}
|
|
65
|
+
style={{ height: '100%', width: '100%' }}
|
|
66
|
+
/>
|
|
67
|
+
</Box>
|
|
68
|
+
</Box>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const hasHeader = [eyebrow, title, description, badges, actions].some((item) => item != null);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Card
|
|
76
|
+
compact={compact}
|
|
77
|
+
onPress={isInteractive ? onPress : undefined}
|
|
78
|
+
testID={testID}
|
|
79
|
+
tone={tone}
|
|
80
|
+
>
|
|
81
|
+
<Stack gap={gap}>
|
|
82
|
+
{renderImage()}
|
|
83
|
+
|
|
84
|
+
{hasHeader ? (
|
|
85
|
+
<Stack
|
|
86
|
+
align={{ base: 'flex-start', md: 'center' }}
|
|
87
|
+
direction={{ base: 'column', md: 'row' }}
|
|
88
|
+
gap="m"
|
|
89
|
+
justify="space-between"
|
|
90
|
+
>
|
|
91
|
+
<Box flex={1}>
|
|
92
|
+
<Stack gap="xs">
|
|
93
|
+
{eyebrow ? (
|
|
94
|
+
<Text tone="muted" variant="caption" weight="semiBold">
|
|
95
|
+
{eyebrow}
|
|
96
|
+
</Text>
|
|
97
|
+
) : null}
|
|
98
|
+
<Stack gap="xs">
|
|
99
|
+
<Heading level={compact ? 4 : 3}>{title}</Heading>
|
|
100
|
+
{badges ? <Box>{badges}</Box> : null}
|
|
101
|
+
</Stack>
|
|
102
|
+
{description ? (
|
|
103
|
+
<Text tone="muted" variant="bodySmall">
|
|
104
|
+
{description}
|
|
105
|
+
</Text>
|
|
106
|
+
) : null}
|
|
107
|
+
</Stack>
|
|
108
|
+
</Box>
|
|
109
|
+
{actions ? <Box>{actions}</Box> : null}
|
|
110
|
+
</Stack>
|
|
111
|
+
) : null}
|
|
112
|
+
|
|
113
|
+
{children ? <Box>{children}</Box> : null}
|
|
114
|
+
{footer ? <Box pt="xs">{footer}</Box> : null}
|
|
115
|
+
</Stack>
|
|
116
|
+
</Card>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const MediaCard = withZoraThemeScope(MediaCardInner);
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { ImageSourcePropType } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import type { ZoraCardTone } from '../../internal/recipes';
|
|
5
|
+
import type { ZoraBaseProps } from '../../theme/ZoraBaseProps';
|
|
6
|
+
|
|
7
|
+
interface MediaCardWithImageSource {
|
|
8
|
+
imageSource: ImageSourcePropType;
|
|
9
|
+
imageLabel?: string;
|
|
10
|
+
image?: never;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface MediaCardWithImageSlot {
|
|
14
|
+
image: React.ReactNode;
|
|
15
|
+
imageSource?: never;
|
|
16
|
+
imageLabel?: never;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface MediaCardWithoutImage {
|
|
20
|
+
image?: never;
|
|
21
|
+
imageSource?: never;
|
|
22
|
+
imageLabel?: never;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type MediaCardImageProps =
|
|
26
|
+
| MediaCardWithImageSource
|
|
27
|
+
| MediaCardWithImageSlot
|
|
28
|
+
| MediaCardWithoutImage;
|
|
29
|
+
|
|
30
|
+
interface MediaCardBaseProps extends ZoraBaseProps {
|
|
31
|
+
title: React.ReactNode;
|
|
32
|
+
description?: React.ReactNode;
|
|
33
|
+
eyebrow?: React.ReactNode;
|
|
34
|
+
badges?: React.ReactNode;
|
|
35
|
+
actions?: React.ReactNode;
|
|
36
|
+
footer?: React.ReactNode;
|
|
37
|
+
children?: React.ReactNode;
|
|
38
|
+
tone?: ZoraCardTone;
|
|
39
|
+
compact?: boolean;
|
|
40
|
+
onPress?: () => void;
|
|
41
|
+
imageAspectRatio?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type MediaCardProps = MediaCardBaseProps & MediaCardImageProps;
|