@atom-learning/components 1.6.1 → 1.6.4
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/components/grid/Grid.d.ts +1 -0
- package/dist/components/grid/Grid.js +1 -1
- package/dist/components/stepper/StepperStepBack.d.ts +1 -1
- package/dist/components/stepper/StepperStepBack.js +1 -1
- package/dist/components/stepper/StepperStepForward.d.ts +1 -1
- package/dist/components/stepper/StepperStepForward.js +1 -1
- package/dist/components/stepper/StepperSteps.d.ts +2 -1
- package/dist/components/stepper/StepperSteps.js +1 -1
- package/dist/components/stepper/types.d.ts +6 -1
- package/dist/docgen.json +1 -1
- package/dist/docs/Grid.mdx +10 -0
- package/dist/docs/Stepper.mdx +4 -4
- package/dist/index.cjs.js +1 -1
- package/package.json +1 -1
|
@@ -268,6 +268,7 @@ declare const GridContainer: import("@stitches/react/types/styled-component").St
|
|
|
268
268
|
}>>;
|
|
269
269
|
declare type GridProps = React.ComponentProps<typeof GridContainer> & {
|
|
270
270
|
minItemSize: string;
|
|
271
|
+
maxItemSize?: string;
|
|
271
272
|
};
|
|
272
273
|
export declare const Grid: React.FC<GridProps>;
|
|
273
274
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as s}from"react";import{theme as m,styled as o}from"../../stitches.js";const d=Object.keys(m.space).reduce((a,e)=>({...a,[e]:{gap:`$space$${e}`}}),{}),c=o("div",{display:"grid",variants:{gap:d}}),t=({css:a,gap:e=2,minItemSize:r,maxItemSize:i="1fr",...p})=>s(c,{css:{...a,gridTemplateColumns:`repeat(auto-fit, minmax(${r}, ${i}))`},gap:e,...p});t.displayName="Grid";export{t as Grid};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '../button';
|
|
3
3
|
import { IStepperNavigateProps } from './types';
|
|
4
|
-
export declare const StepperStepBack: React.FC<IStepperNavigateProps & React.ComponentProps<typeof Button>>;
|
|
4
|
+
export declare const StepperStepBack: React.FC<IStepperNavigateProps & Omit<React.ComponentProps<typeof Button>, 'children'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as i}from"react";import{Button as
|
|
1
|
+
import{createElement as i}from"react";import{Button as n}from"../button/Button.js";import{useStepper as m}from"./stepper-context/StepperContext.js";const c=({label:e,children:o,...r})=>{const{activeStep:t,goToPreviousStep:p}=m();return i(n,{size:"sm",appearance:"outline",...r,disabled:t===0,onClick:p},o||(e==null?void 0:e(t)))};export{c as StepperStepBack};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button } from '../button';
|
|
3
3
|
import { IStepperNavigateProps } from './types';
|
|
4
|
-
export declare const StepperStepForward: React.FC<IStepperNavigateProps & React.ComponentProps<typeof Button>>;
|
|
4
|
+
export declare const StepperStepForward: React.FC<IStepperNavigateProps & Omit<React.ComponentProps<typeof Button>, 'children'>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as m}from"react";import{Button as
|
|
1
|
+
import{createElement as m}from"react";import{Button as i}from"../button/Button.js";import{useStepper as n}from"./stepper-context/StepperContext.js";const s=({label:t,children:e,...o})=>{const{goToNextStep:r,activeStep:p}=n();return m(i,{size:"sm",...o,onClick:r,css:{ml:"auto"}},e||(t==null?void 0:t(p)))};export{s as StepperStepForward};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createElement as
|
|
1
|
+
import{createElement as n}from"react";import{styled as $}from"../../stitches.js";import{Flex as s}from"../flex/Flex.js";import{useStepper as g}from"./stepper-context/StepperContext.js";const u=$(s,{position:"relative",p:"$2",justifyContent:"center",alignItems:"center",width:"$2",height:"$2",borderRadius:"50%",border:"none",bg:"$tonal50",fontFamily:"$body",fontWeight:400,fontSize:"$sm","&:not(:first-child)":{ml:"$3"},"&:not(:last-child)::after":{content:"",height:"1px",position:"absolute",left:"$sizes$2"},variants:{state:{normal:{bg:"$tonal50",color:"$tonal400"},active:{bg:"$primary",color:"white"},viewed:{bg:"$primaryDark",color:"white"}},separator:{normal:{"&:not(:last-child)::after":{bg:"$tonal50"}},highlight:{"&:not(:last-child)::after":{bg:"$primaryDark"}}}}}),f=({css:r,...p})=>{const{steps:a,goToStep:c,activeStep:l,viewedSteps:o,allowSkip:i}=g(),h=e=>l===e?"active":o.includes(e)?"viewed":"normal",m=e=>e<Math.max(...o)?"highlight":"normal";return n(s,{css:{alignItems:"center",justifyContent:"space-between",...r},...p},a.map((e,t)=>n(u,{key:`step_${t}`,as:i?"button":"div",onClick:()=>i&&o.includes(t)?c(t):void 0,state:h(t),separator:m(t),"aria-current":t===l?"step":void 0,"aria-label":`step ${t+1}`,css:{cursor:i&&o.includes(t)?"pointer":"auto","&:not(:last-child)::after":{width:(r==null?void 0:r.width)?`calc((${r.width} - ($2 * ${a.length})) / ${a.length-1})`:"$1"}}},t+1)))};export{f as StepperSteps};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSS } from '../../stitches';
|
|
1
2
|
export declare type Context = {
|
|
2
3
|
steps: unknown[];
|
|
3
4
|
goToPreviousStep: () => void;
|
|
@@ -20,5 +21,9 @@ export interface IStepperProps {
|
|
|
20
21
|
onStepChange?: (activeStep: number) => void;
|
|
21
22
|
}
|
|
22
23
|
export interface IStepperNavigateProps {
|
|
23
|
-
label
|
|
24
|
+
label?: (currentStep?: number) => string;
|
|
25
|
+
}
|
|
26
|
+
export interface IStepperStepsProps {
|
|
27
|
+
css?: CSS;
|
|
28
|
+
stepsWidth?: string;
|
|
24
29
|
}
|