@eclass/ui-kit 1.9.2 → 1.10.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.
@@ -9,6 +9,7 @@ export interface BaseProps {
9
9
  interface IconProps extends BaseProps {
10
10
  viewBox?: string;
11
11
  children: React.ReactChild | React.ReactChild[];
12
+ title?: string;
12
13
  }
13
- export declare function Base({ w, h, color, m, viewBox, children, }: IconProps): JSX.Element;
14
+ export declare function Base({ w, h, color, m, viewBox, children, title, }: IconProps): JSX.Element;
14
15
  export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface props {
3
+ fill?: string;
4
+ }
5
+ export declare function Loader({ fill }: props): JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { BaseProps } from './Base';
3
+ export declare function Multimedia(props: BaseProps): JSX.Element;
4
+ export declare namespace Multimedia {
5
+ var displayName: string;
6
+ }
@@ -3,9 +3,11 @@ export * from './ArrowRight';
3
3
  export * from './Certificate';
4
4
  export * from './CircularCheck';
5
5
  export * from './CircularInformation';
6
+ export * from './Loader';
6
7
  export * from './Profile';
7
8
  export * from './Schedule';
8
9
  export * from './TinyAlertInfo';
9
10
  export * from './TinyAlertError';
10
11
  export * from './TinyAlertWarning';
11
12
  export * from './TinyAlertSuccess';
13
+ export * from './Multimedia';
@@ -10690,7 +10690,7 @@ var ring2 = {
10690
10690
  ringOffsetColor: t.colors("--chakra-ring-offset-color"),
10691
10691
  ringInset: t.prop("--chakra-ring-inset")
10692
10692
  };
10693
- var space = {
10693
+ var space$1 = {
10694
10694
  margin: t.spaceT("margin"),
10695
10695
  marginTop: t.spaceT("marginTop"),
10696
10696
  marginBlockStart: t.spaceT("marginBlockStart"),
@@ -10718,29 +10718,29 @@ var space = {
10718
10718
  paddingY: t.space(["paddingTop", "paddingBottom"]),
10719
10719
  paddingBlock: t.space("paddingBlock")
10720
10720
  };
10721
- Object.assign(space, {
10722
- m: space.margin,
10723
- mt: space.marginTop,
10724
- mr: space.marginRight,
10725
- me: space.marginInlineEnd,
10726
- marginEnd: space.marginInlineEnd,
10727
- mb: space.marginBottom,
10728
- ml: space.marginLeft,
10729
- ms: space.marginInlineStart,
10730
- marginStart: space.marginInlineStart,
10731
- mx: space.marginX,
10732
- my: space.marginY,
10733
- p: space.padding,
10734
- pt: space.paddingTop,
10735
- py: space.paddingY,
10736
- px: space.paddingX,
10737
- pb: space.paddingBottom,
10738
- pl: space.paddingLeft,
10739
- ps: space.paddingInlineStart,
10740
- paddingStart: space.paddingInlineStart,
10741
- pr: space.paddingRight,
10742
- pe: space.paddingInlineEnd,
10743
- paddingEnd: space.paddingInlineEnd
10721
+ Object.assign(space$1, {
10722
+ m: space$1.margin,
10723
+ mt: space$1.marginTop,
10724
+ mr: space$1.marginRight,
10725
+ me: space$1.marginInlineEnd,
10726
+ marginEnd: space$1.marginInlineEnd,
10727
+ mb: space$1.marginBottom,
10728
+ ml: space$1.marginLeft,
10729
+ ms: space$1.marginInlineStart,
10730
+ marginStart: space$1.marginInlineStart,
10731
+ mx: space$1.marginX,
10732
+ my: space$1.marginY,
10733
+ p: space$1.padding,
10734
+ pt: space$1.paddingTop,
10735
+ py: space$1.paddingY,
10736
+ px: space$1.paddingX,
10737
+ pb: space$1.paddingBottom,
10738
+ pl: space$1.paddingLeft,
10739
+ ps: space$1.paddingInlineStart,
10740
+ paddingStart: space$1.paddingInlineStart,
10741
+ pr: space$1.paddingRight,
10742
+ pe: space$1.paddingInlineEnd,
10743
+ paddingEnd: space$1.paddingInlineEnd
10744
10744
  });
10745
10745
  var textDecoration = {
10746
10746
  textDecorationColor: t.colors("textDecorationColor"),
@@ -10987,8 +10987,8 @@ var pseudoSelectors = {
10987
10987
  _light: ".chakra-ui-light &:not([data-theme]),[data-theme=light] &:not([data-theme]),&[data-theme=light]"
10988
10988
  };
10989
10989
  var pseudoPropNames = objectKeys(pseudoSelectors);
10990
- var systemProps = mergeWith({}, background, border, color$1, flexbox, layout, filter$1, ring2, interactivity, grid, others, position, effect, space, scroll, typography$2, textDecoration, transform8, list$1, transition$1);
10991
- Object.assign({}, space, layout, flexbox, grid, position);
10990
+ var systemProps = mergeWith({}, background, border, color$1, flexbox, layout, filter$1, ring2, interactivity, grid, others, position, effect, space$1, scroll, typography$2, textDecoration, transform8, list$1, transition$1);
10991
+ Object.assign({}, space$1, layout, flexbox, grid, position);
10992
10992
  var propNames = [].concat(objectKeys(systemProps), pseudoPropNames);
10993
10993
  var styleProps = _extends$c({}, systemProps, pseudoSelectors);
10994
10994
  var isStyleProp = function isStyleProp2(prop2) {
@@ -16334,7 +16334,7 @@ var radii$1 = {
16334
16334
  "3xl": "1.5rem",
16335
16335
  full: "9999px"
16336
16336
  };
16337
- var shadows = {
16337
+ var shadows$1 = {
16338
16338
  xs: "0 0 0 1px rgba(0, 0, 0, 0.05)",
16339
16339
  sm: "0 1px 2px 0 rgba(0, 0, 0, 0.05)",
16340
16340
  base: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)",
@@ -16406,7 +16406,7 @@ var foundations = _extends$a({
16406
16406
  colors: colors$1
16407
16407
  }, typography$1, {
16408
16408
  sizes: sizes$l,
16409
- shadows,
16409
+ shadows: shadows$1,
16410
16410
  space: spacing,
16411
16411
  borders: borders$2,
16412
16412
  transition
@@ -26121,22 +26121,39 @@ const styles = {
26121
26121
  }
26122
26122
  })
26123
26123
  };
26124
- const base = "solid 1px";
26124
+ const base = "solid .063rem";
26125
26125
  const borders = {
26126
- normal: `${base} ${colors.neutral.silverSand}`,
26126
+ normal: `${base} ${colors.neutral.darkCharcoal}`,
26127
26127
  light: `${base} ${colors.neutral.platinum}`,
26128
26128
  active: `${base} ${colors.main.deepSkyBlue}`,
26129
26129
  success: `${base} ${colors.alert.jadeGreen}`,
26130
- error: `${base} ${colors.alert.red}`
26130
+ error: `${base} ${colors.alert.red}`,
26131
+ white: `solid .125rem ${colors.neutral.white}`
26131
26132
  };
26132
26133
  const radii = {
26133
26134
  small: ".25rem",
26134
26135
  big: ".5rem",
26135
26136
  rounded: "50%"
26136
26137
  };
26138
+ const shadows = {
26139
+ sm: "0 .125rem .5rem 0 rgba(0,0,0,.20)",
26140
+ md: "0 .25rem 1rem 0 rgba(0,0,0,.20)",
26141
+ lg: "0 .5rem 2rem 0 rgba(0,0,0,.20)"
26142
+ };
26143
+ const space = {
26144
+ xxs: ".25rem",
26145
+ xs: ".5rem",
26146
+ s: "1rem",
26147
+ m: "1.5rem",
26148
+ l: "2rem",
26149
+ xl: "3rem",
26150
+ xxl: "5rem"
26151
+ };
26137
26152
  const utils = {
26138
26153
  borders,
26139
- radii
26154
+ radii,
26155
+ shadows,
26156
+ space
26140
26157
  };
26141
26158
  var _700 = "";
26142
26159
  var _500 = "";
@@ -26346,12 +26363,12 @@ var withAttrs = function(Component) {
26346
26363
  return React__default.createElement(Component, __assign({}, props));
26347
26364
  };
26348
26365
  };
26349
- var ReactRipples = withAttrs(createRipples());
26366
+ var Ripples$1 = withAttrs(createRipples());
26350
26367
  function Ripples({
26351
26368
  children,
26352
26369
  color: color2 = "rgba(204,204,204,0.2)"
26353
26370
  }) {
26354
- return /* @__PURE__ */ jsx(ReactRipples, {
26371
+ return /* @__PURE__ */ jsx(Ripples$1, {
26355
26372
  during: 1e3,
26356
26373
  color: color2,
26357
26374
  children: /* @__PURE__ */ jsx(Box, {
@@ -26366,15 +26383,18 @@ function Base({
26366
26383
  color: color2 = vars("colors-main-ziggurat"),
26367
26384
  m: m2 = "0",
26368
26385
  viewBox = "0 0 16 16",
26369
- children
26386
+ children,
26387
+ title
26370
26388
  }) {
26371
- return /* @__PURE__ */ jsx(Icon, {
26389
+ return /* @__PURE__ */ jsxs(Icon, {
26372
26390
  w: w2,
26373
26391
  h,
26374
26392
  viewBox,
26375
26393
  color: color2,
26376
26394
  m: m2,
26377
- children
26395
+ children: [/* @__PURE__ */ jsxs("title", {
26396
+ children: ["icon", title && `-${title}`]
26397
+ }), children]
26378
26398
  });
26379
26399
  }
26380
26400
  function AlertInfo(props) {
@@ -26486,11 +26506,56 @@ function CircularInformation(props) {
26486
26506
  }));
26487
26507
  }
26488
26508
  CircularInformation.displayName = "CircularInformation";
26509
+ function Loader({
26510
+ fill = "#fff"
26511
+ }) {
26512
+ return /* @__PURE__ */ jsx("div", {
26513
+ className: "loaderAsync",
26514
+ "data-testid": "loaderAsync",
26515
+ children: /* @__PURE__ */ jsxs("svg", {
26516
+ id: "prefix__eXySq0EBKm11",
26517
+ xmlns: "http://www.w3.org/2000/svg",
26518
+ viewBox: "0 0 38 20",
26519
+ shapeRendering: "geometricPrecision",
26520
+ textRendering: "geometricPrecision",
26521
+ width: 38,
26522
+ height: 20,
26523
+ children: [/* @__PURE__ */ jsx("style", {
26524
+ dangerouslySetInnerHTML: {
26525
+ __html: "@keyframes eXySq0EBKm12_f_o{0%,33.333333%,to{fill-opacity:.4}66.666667%{fill-opacity:1;animation-timing-function:cubic-bezier(.42,0,.58,1)}}@keyframes eXySq0EBKm13_f_o{0%,66.666667%,to{fill-opacity:.4}33.333333%{fill-opacity:1;animation-timing-function:cubic-bezier(.42,0,.58,1)}}@keyframes eXySq0EBKm14_f_o{0%{fill-opacity:1;animation-timing-function:cubic-bezier(.42,0,.58,1)}33.333333%,66.666667%{fill-opacity:.4}to{fill-opacity:1}}"
26526
+ }
26527
+ }), /* @__PURE__ */ jsx("circle", {
26528
+ r: 2.502,
26529
+ transform: "translate(29.526 10)",
26530
+ fill,
26531
+ fillOpacity: 0.4,
26532
+ style: {
26533
+ animation: "eXySq0EBKm12_f_o 600ms linear infinite normal forwards"
26534
+ }
26535
+ }), /* @__PURE__ */ jsx("circle", {
26536
+ r: 2.502,
26537
+ transform: "translate(19 10)",
26538
+ fill,
26539
+ fillOpacity: 0.4,
26540
+ style: {
26541
+ animation: "eXySq0EBKm13_f_o 600ms linear infinite normal forwards"
26542
+ }
26543
+ }), /* @__PURE__ */ jsx("circle", {
26544
+ r: 2.053,
26545
+ transform: "matrix(1.21764 0 0 1.21764 8.562 10.002)",
26546
+ fill,
26547
+ style: {
26548
+ animation: "eXySq0EBKm14_f_o 600ms linear infinite normal forwards"
26549
+ }
26550
+ })]
26551
+ })
26552
+ });
26553
+ }
26489
26554
  function Profile(props) {
26490
26555
  return /* @__PURE__ */ jsx(Base, __spreadProps(__spreadValues({}, props), {
26491
26556
  viewBox: "0 0 12 12",
26492
- w: ".625rem",
26493
- h: ".75rem",
26557
+ w: "12px",
26558
+ title: "profile",
26494
26559
  children: /* @__PURE__ */ jsx("path", {
26495
26560
  fill: "currentColor",
26496
26561
  d: "M5 6a3 3 0 100-6 3 3 0 000 6zM5 7c-3.375 0-5 2.106-5 3.333V11a1 1 0 001 1h8a1 1 0 001-1v-.667C10 9.106 8.375 7 5 7z"
@@ -26629,6 +26694,27 @@ function TinyAlertSuccess(props) {
26629
26694
  }));
26630
26695
  }
26631
26696
  TinyAlertSuccess.displayName = "TinyAlertSuccess";
26697
+ function Multimedia(props) {
26698
+ return /* @__PURE__ */ jsxs(Base, __spreadProps(__spreadValues({}, props), {
26699
+ w: "12px",
26700
+ viewBox: "0 0 14 14",
26701
+ title: "multimedia",
26702
+ children: [/* @__PURE__ */ jsx("path", {
26703
+ d: "M3 6C4.65685 6 6 4.65685 6 3C6 1.34315 4.65685 0 3 0C1.34315 0 0 1.34315 0 3C0 4.65685 1.34315 6 3 6Z",
26704
+ fill: "currentColor"
26705
+ }), /* @__PURE__ */ jsx("path", {
26706
+ d: "M11 6C12.6569 6 14 4.65685 14 3C14 1.34315 12.6569 0 11 0C9.34315 0 8 1.34315 8 3C8 4.65685 9.34315 6 11 6Z",
26707
+ fill: "currentColor"
26708
+ }), /* @__PURE__ */ jsx("path", {
26709
+ d: "M3 14C4.65685 14 6 12.6569 6 11C6 9.34315 4.65685 8 3 8C1.34315 8 0 9.34315 0 11C0 12.6569 1.34315 14 3 14Z",
26710
+ fill: "currentColor"
26711
+ }), /* @__PURE__ */ jsx("path", {
26712
+ d: "M11 14C12.6569 14 14 12.6569 14 11C14 9.34315 12.6569 8 11 8C9.34315 8 8 9.34315 8 11C8 12.6569 9.34315 14 11 14Z",
26713
+ fill: "currentColor"
26714
+ })]
26715
+ }));
26716
+ }
26717
+ Multimedia.displayName = "Multimedia";
26632
26718
  function TinyAlert({
26633
26719
  status,
26634
26720
  text,
@@ -26698,6 +26784,7 @@ function TinyAlert({
26698
26784
  gap: ".25rem",
26699
26785
  width: "fit-content",
26700
26786
  borderRadius: ".25rem",
26787
+ className: "TinyAlert-Box",
26701
26788
  children: [alerts[status].icon && /* @__PURE__ */ jsx(Box, {
26702
26789
  lineHeight: 0,
26703
26790
  sx: {
@@ -26720,6 +26807,205 @@ function TinyAlert({
26720
26807
  });
26721
26808
  }
26722
26809
  TinyAlert.displayName = "TinyAlert";
26810
+ function Btn({
26811
+ bg: bg2,
26812
+ borderColorActive = [vars("colors-main-deepSkyBlue"), vars("colors-neutral-white")],
26813
+ children,
26814
+ color: color2 = vars("colors-neutral-white"),
26815
+ disabled: disabled2 = false,
26816
+ fillLoader = vars("colors-neutral-white"),
26817
+ isFullWidth = false,
26818
+ leftIcon,
26819
+ m: m2 = "0",
26820
+ isLoading = false,
26821
+ onClick,
26822
+ rightIcon,
26823
+ rounded = false,
26824
+ size: size2 = "regular",
26825
+ touchDark = false
26826
+ }) {
26827
+ var _a, _b, _c;
26828
+ let showChildren = children != null ? children : null;
26829
+ if (!children && !rightIcon && !leftIcon) {
26830
+ showChildren = "Button";
26831
+ }
26832
+ const borderRadius = rounded ? "12px" : vars("radii-small");
26833
+ const colorMain = (_a = bg2 == null ? void 0 : bg2.main) != null ? _a : vars("colors-main-deepSkyBlue");
26834
+ const touchColor = touchDark ? "rgba(160, 160, 160, 0.2)" : "rgba(255, 255, 255, 0.2)";
26835
+ const onlyIcon = !children && (rightIcon != null ? rightIcon : leftIcon) ? "onlyIcon" : "";
26836
+ return /* @__PURE__ */ jsx(Box, {
26837
+ margin: m2,
26838
+ sx: {
26839
+ ".react-ripples": {
26840
+ borderRadius,
26841
+ display: `${isFullWidth ? "grid" : "inline-flex!important"}`
26842
+ }
26843
+ },
26844
+ children: /* @__PURE__ */ jsx(Ripples$1, {
26845
+ color: touchColor,
26846
+ children: /* @__PURE__ */ jsx(Button, {
26847
+ fontWeight: "500",
26848
+ fontSize: size2 === "regular" ? "medium" : "small",
26849
+ bg: colorMain,
26850
+ size: size2 === "regular" ? "md" : "sm",
26851
+ borderRadius,
26852
+ color: color2,
26853
+ className: onlyIcon,
26854
+ disabled: disabled2,
26855
+ height: "auto",
26856
+ iconSpacing: vars("space-xs"),
26857
+ isActive: false,
26858
+ isLoading,
26859
+ leftIcon,
26860
+ onClick: (e2) => {
26861
+ !isLoading && !disabled2 && (onClick == null ? void 0 : onClick(e2));
26862
+ },
26863
+ paddingTop: size2 === "regular" ? vars("space-xs") : vars("space-xxs"),
26864
+ paddingBottom: size2 === "regular" ? vars("space-xs") : vars("space-xxs"),
26865
+ paddingLeft: size2 === "regular" ? vars("space-s") : vars("space-xs"),
26866
+ paddingRight: size2 === "regular" ? vars("space-s") : vars("space-xs"),
26867
+ position: "relative",
26868
+ isFullWidth,
26869
+ rightIcon,
26870
+ spinner: /* @__PURE__ */ jsx(Loader, {
26871
+ fill: fillLoader
26872
+ }),
26873
+ _active: {
26874
+ bg: (_b = bg2 == null ? void 0 : bg2.main) != null ? _b : vars("colors-main-azureRadiance")
26875
+ },
26876
+ _disabled: {
26877
+ opacity: "50%",
26878
+ cursor: "not-allowed"
26879
+ },
26880
+ _focus: {
26881
+ boxShadow: `inset 0 0 0 2px ${borderColorActive[0]}, inset 0 0 0 4px ${borderColorActive[1]}`
26882
+ },
26883
+ _hover: {
26884
+ bg: (_c = bg2 == null ? void 0 : bg2.hover) != null ? _c : vars("colors-main-azureRadiance")
26885
+ },
26886
+ sx: {
26887
+ "&[data-loading]": {
26888
+ boxShadow: "none",
26889
+ cursor: "wait"
26890
+ },
26891
+ "&.onlyIcon span": {
26892
+ m: 0
26893
+ },
26894
+ span: {
26895
+ h: "1rem"
26896
+ }
26897
+ },
26898
+ children: showChildren
26899
+ })
26900
+ })
26901
+ });
26902
+ }
26903
+ Btn.displayName = "Btn";
26904
+ function BtnPrimary({
26905
+ children,
26906
+ disabled: disabled2 = false,
26907
+ isFullWidth = false,
26908
+ leftIcon,
26909
+ m: m2 = "0",
26910
+ isLoading = false,
26911
+ onClick,
26912
+ rightIcon,
26913
+ size: size2 = "regular"
26914
+ }) {
26915
+ return /* @__PURE__ */ jsx(Btn, {
26916
+ disabled: disabled2,
26917
+ isFullWidth,
26918
+ isLoading,
26919
+ leftIcon,
26920
+ m: m2,
26921
+ onClick,
26922
+ rightIcon,
26923
+ size: size2,
26924
+ children
26925
+ });
26926
+ }
26927
+ BtnPrimary.displayName = "BtnPrimary";
26928
+ function BtnSecondary({
26929
+ children,
26930
+ disabled: disabled2 = false,
26931
+ isFullWidth = false,
26932
+ leftIcon,
26933
+ m: m2 = "0",
26934
+ isLoading = false,
26935
+ onClick,
26936
+ rightIcon,
26937
+ size: size2 = "regular"
26938
+ }) {
26939
+ return /* @__PURE__ */ jsx(Btn, {
26940
+ bg: {
26941
+ main: vars("colors-main-veryLightBlue"),
26942
+ hover: vars("colors-main-linkWater")
26943
+ },
26944
+ fillLoader: vars("colors-main-deepSkyBlue"),
26945
+ borderColorActive: [vars("colors-main-deepSkyBlue"), vars("colors-neutral-white")],
26946
+ color: vars("colors-main-deepSkyBlue"),
26947
+ disabled: disabled2,
26948
+ isFullWidth,
26949
+ isLoading,
26950
+ leftIcon,
26951
+ m: m2,
26952
+ onClick,
26953
+ rightIcon,
26954
+ size: size2,
26955
+ touchDark: true,
26956
+ children
26957
+ });
26958
+ }
26959
+ BtnSecondary.displayName = "BtnSecondary";
26960
+ function BtnTertiary({
26961
+ children,
26962
+ rightIcon = false,
26963
+ withoutColor = false,
26964
+ m: m2 = "0",
26965
+ onClick
26966
+ }) {
26967
+ const gray = vars("colors-neutral-gray");
26968
+ const blue = vars("colors-main-deepSkyBlue");
26969
+ const white = vars("colors-neutral-white");
26970
+ const colorIcon = withoutColor ? gray : blue;
26971
+ const rIcon = rightIcon ? /* @__PURE__ */ jsx(Multimedia, {
26972
+ color: colorIcon
26973
+ }) : void 0;
26974
+ const lIcon = !rightIcon ? /* @__PURE__ */ jsx(Multimedia, {
26975
+ color: colorIcon
26976
+ }) : void 0;
26977
+ return /* @__PURE__ */ jsx(Button, {
26978
+ height: "24px",
26979
+ background: white,
26980
+ fontFamily: "Roboto",
26981
+ fontStyle: "normal",
26982
+ fontWeight: "500",
26983
+ fontSize: "14px",
26984
+ lineHeight: "16px",
26985
+ textDecorationLine: "underline",
26986
+ borderRadius: "12px",
26987
+ color: gray,
26988
+ rightIcon: rIcon,
26989
+ leftIcon: lIcon,
26990
+ m: m2,
26991
+ onClick,
26992
+ _hover: {
26993
+ color: blue
26994
+ },
26995
+ _focus: {
26996
+ boxShadow: `inset 0 0 0 2px ${blue}, inset 0 0 0 4px ${white}`
26997
+ },
26998
+ sx: {
26999
+ "&:hover": {
27000
+ "svg path": {
27001
+ fill: blue
27002
+ }
27003
+ }
27004
+ },
27005
+ children
27006
+ });
27007
+ }
27008
+ BtnTertiary.displayName = "BtnTertiary";
26723
27009
  const STUDENT = 4;
26724
27010
  function Header() {
26725
27011
  const {
@@ -27891,5 +28177,5 @@ function CourseList({
27891
28177
  });
27892
28178
  }
27893
28179
  CourseList.displayName = "CourseList";
27894
- export { CourseList, Label, Progress, Ripples, TinyAlert, dataFake, maxWidthCoursesList, theme, vars };
28180
+ export { Btn, BtnPrimary, BtnSecondary, BtnTertiary, CourseList, Label, Progress, Ripples, TinyAlert, dataFake, maxWidthCoursesList, theme, vars };
27895
28181
  //# sourceMappingURL=eclass-ui-kit.es.js.map