@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.
@@ -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 p}from"react";import{theme as s,styled as m}from"../../stitches.js";const o=Object.keys(s.space).reduce((a,e)=>({...a,[e]:{gap:`$space$${e}`}}),{}),d=m("div",{display:"grid",variants:{gap:o}}),t=({css:a,gap:e=2,minItemSize:r,...i})=>p(d,{css:{...a,gridTemplateColumns:`repeat(auto-fit, minmax(${r}, 1fr))`},gap:e,...i});t.displayName="Grid";export{t as Grid};
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 m}from"../button/Button.js";import{useStepper as n}from"./stepper-context/StepperContext.js";const a=({label:t,children:o,...r})=>{const{activeStep:e,goToPreviousStep:p}=n();return i(m,{size:"sm",appearance:"outline",...r,disabled:e===0,onClick:p},o||t(e))};export{a as StepperStepBack};
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 s}from"../button/Button.js";import{useStepper as c}from"./stepper-context/StepperContext.js";const i=({label:t,children:e,...o})=>{const{goToNextStep:r,activeStep:p}=c();return m(s,{size:"sm",...o,onClick:r,css:{ml:"auto"}},e||t(p))};export{i as StepperStepForward};
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,2 +1,3 @@
1
1
  import * as React from 'react';
2
- export declare const StepperSteps: React.FC;
2
+ import { IStepperStepsProps } from './types';
3
+ export declare const StepperSteps: React.FC<IStepperStepsProps>;
@@ -1 +1 @@
1
- import{createElement as a}from"react";import{styled as c}from"../../stitches.js";import{Flex as i}from"../flex/Flex.js";import{useStepper as m}from"./stepper-context/StepperContext.js";const h=c(i,{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:"",width:"$1",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:"$tonal400"}},highlight:{"&:not(:last-child)::after":{bg:"$primary"}}}}}),$=()=>{const{steps:l,goToStep:s,activeStep:e,viewedSteps:n,allowSkip:r}=m(),p=o=>e===o?"active":n.includes(o)?"viewed":"normal";return a(i,{css:{alignItems:"center"}},l.map((o,t)=>a(h,{key:`step_${t}`,as:r?"button":"div",onClick:()=>r?s(t):void 0,state:p(t),separator:t<e?"highlight":"normal","aria-current":t===e?"step":void 0,"aria-label":`step ${t+1}`,css:{cursor:r?"pointer":"auto"}},t+1)))};export{$ as StepperSteps};
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: (currentStep?: number) => string;
24
+ label?: (currentStep?: number) => string;
25
+ }
26
+ export interface IStepperStepsProps {
27
+ css?: CSS;
28
+ stepsWidth?: string;
24
29
  }