@ndla/primitives 0.0.19 → 0.0.20

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.
@@ -74,10 +74,8 @@
74
74
  "content]___[value:counter(level1, lower-alpha) '. ']___[cond:& > li<___>& > ol[data-variant='letters'] > li<___>_marker",
75
75
  "content]___[value:counter(level1, lower-roman) '. ']___[cond:& > li<___>& > ol[data-variant='letters'] > li<___>& > ol[data-variant='letters'] > li<___>_marker",
76
76
  "listStyle]___[value:revert",
77
- "listStylePosition]___[value:inside",
78
77
  "paddingInlineStart]___[value:medium",
79
78
  "color]___[value:icon.strong]___[cond:& li<___>_marker",
80
- "display]___[value:inline]___[cond:& li > *:not(ol, ul, li)",
81
79
  "fontWeight]___[value:bold]___[cond:& dt",
82
80
  "marginInlineStart]___[value:medium]___[cond:& dd",
83
81
  "paddingInline]___[value:xsmall",
@@ -327,6 +325,19 @@
327
325
  "borderRadius]___[value:small",
328
326
  "backgroundColor]___[value:surface.default",
329
327
  "backgroundColor]___[value:surface.brand.2.subtle",
328
+ "height]___[value:350px",
329
+ "zIndex]___[value:hide",
330
+ "clipPath]___[value:polygon(0 0, 100% 0, 100% 65%, 0 100%)",
331
+ "position]___[value:absolute",
332
+ "background]___[value:primary",
333
+ "background]___[value:blue.800",
334
+ "background]___[value:surface.brand.2",
335
+ "background]___[value:surface.brand.1",
336
+ "background]___[value:surface.infoSubtle",
337
+ "background]___[value:surface.brand.4",
338
+ "flexWrap]___[value:wrap",
339
+ "alignItems]___[value:flex-end",
340
+ "paddingBlockStart]___[value:xxlarge]___[cond:tablet",
330
341
  "outline]___[value:1px solid",
331
342
  "background]___[value:background.default",
332
343
  "minHeight]___[value:xxlarge",
@@ -375,7 +386,6 @@
375
386
  "boxShadow]___[value:small",
376
387
  "alignItems]___[value:flex-start",
377
388
  "gap]___[value:small",
378
- "background]___[value:surface.infoSubtle",
379
389
  "background]___[value:surface.warningSubtle",
380
390
  "borderColor]___[value:stroke.warning",
381
391
  "background]___[value:surface.successSubtle",
@@ -390,7 +400,6 @@
390
400
  "animation]___[value:fade-shift-out 0.2s ease-out]___[cond:_closed",
391
401
  "--arrow-size]___[value:sizes.xxsmall",
392
402
  "--arrow-background]___[value:colors.surface.default",
393
- "flexWrap]___[value:wrap",
394
403
  "flexDirection]___[value:column]___[cond:_vertical",
395
404
  "flexDirection]___[value:row]___[cond:_horizontal",
396
405
  "borderRadius]___[value:full",
@@ -569,7 +578,6 @@
569
578
  "zIndex]___[value:var(--z-index)",
570
579
  "transitionDuration]___[value:slow",
571
580
  "transitionProperty]___[value:translate, scale, opacity, height",
572
- "position]___[value:absolute",
573
581
  "top]___[value:xxsmall",
574
582
  "right]___[value:xxsmall",
575
583
  "paddingInline]___[value:xxsmall",
package/dist/styles.css CHANGED
@@ -544,6 +544,47 @@
544
544
  border-radius: var(--radii-small);
545
545
  }
546
546
 
547
+ .h_350px {
548
+ height: 350px;
549
+ }
550
+
551
+ .z_hide {
552
+ z-index: var(--z-index-hide);
553
+ }
554
+
555
+ .cp-path_polygon\(0_0\,_100\%_0\,_100\%_65\%\,_0_100\%\) {
556
+ clip-path: polygon(0 0, 100% 0, 100% 65%, 0 100%);
557
+ -webkit-clip-path: polygon(0 0, 100% 0, 100% 65%, 0 100%);
558
+ }
559
+
560
+ .pos_absolute {
561
+ position: absolute;
562
+ }
563
+
564
+ .bg_primary {
565
+ background: var(--colors-primary);
566
+ }
567
+
568
+ .bg_blue\.800 {
569
+ background: var(--colors-blue-800);
570
+ }
571
+
572
+ .bg_surface\.brand\.2 {
573
+ background: var(--colors-surface-brand-2);
574
+ }
575
+
576
+ .bg_surface\.brand\.1 {
577
+ background: var(--colors-surface-brand-1);
578
+ }
579
+
580
+ .bg_surface\.infoSubtle {
581
+ background: var(--colors-surface-info-subtle);
582
+ }
583
+
584
+ .bg_surface\.brand\.4 {
585
+ background: var(--colors-surface-brand-4);
586
+ }
587
+
547
588
  .ring_1px_solid {
548
589
  outline: 1px solid;
549
590
  }
@@ -616,10 +657,6 @@
616
657
  gap: var(--spacing-small);
617
658
  }
618
659
 
619
- .bg_surface\.infoSubtle {
620
- background: var(--colors-surface-info-subtle);
621
- }
622
-
623
660
  .bg_surface\.warningSubtle {
624
661
  background: var(--colors-surface-warning-subtle);
625
662
  }
@@ -828,10 +865,6 @@
828
865
  z-index: var(--z-index);
829
866
  }
830
867
 
831
- .pos_absolute {
832
- position: absolute;
833
- }
834
-
835
868
  .px_xxsmall {
836
869
  padding-inline: var(--spacing-xxsmall);
837
870
  }
@@ -906,10 +939,6 @@
906
939
  border-color: var(--colors-stroke-default);
907
940
  }
908
941
 
909
- .li-pos_inside {
910
- list-style-position: inside;
911
- }
912
-
913
942
  .bg-c_surface\.brand\.1\.subtle {
914
943
  background-color: var(--colors-surface-brand-1-subtle);
915
944
  }
@@ -1002,6 +1031,14 @@
1002
1031
  background-color: var(--colors-surface-brand-2-subtle);
1003
1032
  }
1004
1033
 
1034
+ .flex-wrap_wrap {
1035
+ flex-wrap: wrap;
1036
+ }
1037
+
1038
+ .ai_flex-end {
1039
+ align-items: flex-end;
1040
+ }
1041
+
1005
1042
  .ov-y_hidden {
1006
1043
  overflow-y: hidden;
1007
1044
  }
@@ -1031,10 +1068,6 @@
1031
1068
  font-variant-numeric: tabular-nums;
1032
1069
  }
1033
1070
 
1034
- .flex-wrap_wrap {
1035
- flex-wrap: wrap;
1036
- }
1037
-
1038
1071
  .bd-w_2px {
1039
1072
  border-width: 2px;
1040
1073
  }
@@ -1200,10 +1233,6 @@
1200
1233
  counter-increment: level1;
1201
1234
  }
1202
1235
 
1203
- .\[\&_li_\>_\*\:not\(ol\,_ul\,_li\)\]\:d_inline li > *:not(ol, ul, li) {
1204
- display: inline;
1205
- }
1206
-
1207
1236
  .\[\&_dd\]\:ms_medium dd {
1208
1237
  margin-inline-start: var(--spacing-medium);
1209
1238
  }
@@ -2348,6 +2377,9 @@
2348
2377
  }
2349
2378
  .tablet\:clear_right {
2350
2379
  clear: right;
2380
+ }
2381
+ .tablet\:pbs_xxlarge {
2382
+ padding-block-start: var(--spacing-xxlarge);
2351
2383
  }
2352
2384
  }
2353
2385
 
@@ -126,16 +126,12 @@ export const OrderedList = /*#__PURE__*/forwardRef((_ref, ref) => {
126
126
  export const UnOrderedList = styled("ul", {
127
127
  base: {
128
128
  listStyle: "revert",
129
- listStylePosition: "inside",
130
129
  paddingInlineStart: "medium",
131
130
  "& li": {
132
131
  marginBlock: "small",
133
132
  _marker: {
134
133
  color: "icon.strong"
135
134
  }
136
- },
137
- "& li > *:not(ol, ul, li)": {
138
- display: "inline"
139
135
  }
140
136
  }
141
137
  });
package/es/Hero.js ADDED
@@ -0,0 +1,108 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+
9
+ import { ark } from "@ark-ui/react";
10
+ import { sva } from "@ndla/styled-system/css";
11
+ import { createStyleContext } from "./createStyleContext";
12
+ const heroRecipe = sva({
13
+ slots: ["root", "background", "content"],
14
+ base: {
15
+ root: {
16
+ width: "100%",
17
+ position: "relative",
18
+ zIndex: "base"
19
+ },
20
+ background: {
21
+ height: "350px",
22
+ width: "100%",
23
+ zIndex: "hide",
24
+ overflow: "hidden",
25
+ clipPath: "polygon(0 0, 100% 0, 100% 65%, 0 100%)"
26
+ },
27
+ content: {
28
+ display: "flex",
29
+ flexWrap: "wrap",
30
+ alignItems: "flex-end",
31
+ paddingBlock: "xsmall",
32
+ tablet: {
33
+ paddingBlockStart: "xxlarge"
34
+ }
35
+ }
36
+ },
37
+ defaultVariants: {
38
+ variant: "primary",
39
+ absolute: true
40
+ },
41
+ variants: {
42
+ absolute: {
43
+ true: {
44
+ background: {
45
+ position: "absolute"
46
+ }
47
+ }
48
+ },
49
+ variant: {
50
+ primary: {
51
+ background: {
52
+ background: "primary"
53
+ },
54
+ content: {
55
+ color: "text.onAction"
56
+ }
57
+ },
58
+ brand2Strong: {
59
+ background: {
60
+ // TODO: This is not a semantic token.
61
+ background: "blue.800"
62
+ },
63
+ content: {
64
+ color: "text.onAction"
65
+ }
66
+ },
67
+ brand2: {
68
+ background: {
69
+ background: "surface.brand.2"
70
+ }
71
+ },
72
+ brand1: {
73
+ background: {
74
+ background: "surface.brand.1"
75
+ }
76
+ },
77
+ brand1Subtle: {
78
+ background: {
79
+ background: "surface.brand.1.subtle"
80
+ }
81
+ },
82
+ neutral: {
83
+ background: {
84
+ background: "surface.infoSubtle"
85
+ }
86
+ },
87
+ brand4: {
88
+ background: {
89
+ // TODO: This needs a proper color...
90
+ background: "surface.brand.4"
91
+ }
92
+ }
93
+ }
94
+ }
95
+ });
96
+ const {
97
+ withProvider,
98
+ withContext
99
+ } = createStyleContext(heroRecipe);
100
+ export const Hero = withProvider(ark.div, "root", {
101
+ baseComponent: true
102
+ });
103
+ export const HeroBackground = withContext(ark.div, "background", {
104
+ baseComponent: true
105
+ });
106
+ export const HeroContent = withContext(ark.div, "content", {
107
+ baseComponent: true
108
+ });
package/es/index.js CHANGED
@@ -21,6 +21,7 @@ export { FieldErrorMessage } from "./FieldErrorMessage";
21
21
  export { FieldHelper } from "./FieldHelper";
22
22
  export { Figure } from "./Figure";
23
23
  export { FramedContent } from "./FramedContent";
24
+ export { Hero, HeroBackground, HeroContent } from "./Hero";
24
25
  export { Picture, Img, Image, makeSrcQueryString, getSrcSet } from "./Image";
25
26
  export { Input, FieldInput, InputContainer, TextArea, FieldTextArea } from "./Input";
26
27
  export { Label, FieldLabel } from "./Label";
@@ -132,16 +132,12 @@ const OrderedList = exports.OrderedList = /*#__PURE__*/(0, _react.forwardRef)((_
132
132
  const UnOrderedList = exports.UnOrderedList = (0, _jsx2.styled)("ul", {
133
133
  base: {
134
134
  listStyle: "revert",
135
- listStylePosition: "inside",
136
135
  paddingInlineStart: "medium",
137
136
  "& li": {
138
137
  marginBlock: "small",
139
138
  _marker: {
140
139
  color: "icon.strong"
141
140
  }
142
- },
143
- "& li > *:not(ol, ul, li)": {
144
- display: "inline"
145
141
  }
146
142
  }
147
143
  });
package/lib/Hero.d.ts ADDED
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Copyright (c) 2024-present, NDLA.
3
+ *
4
+ * This source code is licensed under the GPLv3 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ import { type HTMLArkProps } from "@ark-ui/react";
9
+ import { type RecipeVariantProps } from "@ndla/styled-system/css";
10
+ import { type JsxStyleProps } from "@ndla/styled-system/types";
11
+ declare const heroRecipe: import("@ndla/styled-system/types").SlotRecipeRuntimeFn<"content" | "root" | "background", {
12
+ absolute: {
13
+ true: {
14
+ background: {
15
+ position: "absolute";
16
+ };
17
+ };
18
+ };
19
+ variant: {
20
+ primary: {
21
+ background: {
22
+ background: "primary";
23
+ };
24
+ content: {
25
+ color: "text.onAction";
26
+ };
27
+ };
28
+ brand2Strong: {
29
+ background: {
30
+ background: "blue.800";
31
+ };
32
+ content: {
33
+ color: "text.onAction";
34
+ };
35
+ };
36
+ brand2: {
37
+ background: {
38
+ background: "surface.brand.2";
39
+ };
40
+ };
41
+ brand1: {
42
+ background: {
43
+ background: "surface.brand.1";
44
+ };
45
+ };
46
+ brand1Subtle: {
47
+ background: {
48
+ background: "surface.brand.1.subtle";
49
+ };
50
+ };
51
+ neutral: {
52
+ background: {
53
+ background: "surface.infoSubtle";
54
+ };
55
+ };
56
+ brand4: {
57
+ background: {
58
+ background: "surface.brand.4";
59
+ };
60
+ };
61
+ };
62
+ }>;
63
+ export type HeroVariantProps = RecipeVariantProps<typeof heroRecipe>;
64
+ export type HeroVariant = NonNullable<HeroVariantProps>["variant"];
65
+ export type HeroProps = HTMLArkProps<"div"> & JsxStyleProps & HeroVariantProps;
66
+ export declare const Hero: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
67
+ consumeCss?: boolean | undefined;
68
+ } & import("@ndla/styled-system/types").WithCss & {
69
+ absolute?: boolean | undefined;
70
+ variant?: "primary" | "neutral" | "brand1" | "brand2" | "brand2Strong" | "brand1Subtle" | "brand4" | undefined;
71
+ } & import("react").RefAttributes<HTMLDivElement>>;
72
+ export type HeroBackgroundProps = HTMLArkProps<"div"> & JsxStyleProps;
73
+ export declare const HeroBackground: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
74
+ consumeCss?: boolean | undefined;
75
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
76
+ export type HeroContentProps = HTMLArkProps<"div"> & JsxStyleProps;
77
+ export declare const HeroContent: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("@ark-ui/react").PolymorphicProps & {
78
+ consumeCss?: boolean | undefined;
79
+ } & import("@ndla/styled-system/types").WithCss & import("react").RefAttributes<HTMLDivElement>>;
80
+ export {};
package/lib/Hero.js ADDED
@@ -0,0 +1,114 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.HeroContent = exports.HeroBackground = exports.Hero = void 0;
7
+ var _react = require("@ark-ui/react");
8
+ var _css = require("@ndla/styled-system/css");
9
+ var _createStyleContext = require("./createStyleContext");
10
+ /**
11
+ * Copyright (c) 2024-present, NDLA.
12
+ *
13
+ * This source code is licensed under the GPLv3 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ */
17
+
18
+ const heroRecipe = (0, _css.sva)({
19
+ slots: ["root", "background", "content"],
20
+ base: {
21
+ root: {
22
+ width: "100%",
23
+ position: "relative",
24
+ zIndex: "base"
25
+ },
26
+ background: {
27
+ height: "350px",
28
+ width: "100%",
29
+ zIndex: "hide",
30
+ overflow: "hidden",
31
+ clipPath: "polygon(0 0, 100% 0, 100% 65%, 0 100%)"
32
+ },
33
+ content: {
34
+ display: "flex",
35
+ flexWrap: "wrap",
36
+ alignItems: "flex-end",
37
+ paddingBlock: "xsmall",
38
+ tablet: {
39
+ paddingBlockStart: "xxlarge"
40
+ }
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "primary",
45
+ absolute: true
46
+ },
47
+ variants: {
48
+ absolute: {
49
+ true: {
50
+ background: {
51
+ position: "absolute"
52
+ }
53
+ }
54
+ },
55
+ variant: {
56
+ primary: {
57
+ background: {
58
+ background: "primary"
59
+ },
60
+ content: {
61
+ color: "text.onAction"
62
+ }
63
+ },
64
+ brand2Strong: {
65
+ background: {
66
+ // TODO: This is not a semantic token.
67
+ background: "blue.800"
68
+ },
69
+ content: {
70
+ color: "text.onAction"
71
+ }
72
+ },
73
+ brand2: {
74
+ background: {
75
+ background: "surface.brand.2"
76
+ }
77
+ },
78
+ brand1: {
79
+ background: {
80
+ background: "surface.brand.1"
81
+ }
82
+ },
83
+ brand1Subtle: {
84
+ background: {
85
+ background: "surface.brand.1.subtle"
86
+ }
87
+ },
88
+ neutral: {
89
+ background: {
90
+ background: "surface.infoSubtle"
91
+ }
92
+ },
93
+ brand4: {
94
+ background: {
95
+ // TODO: This needs a proper color...
96
+ background: "surface.brand.4"
97
+ }
98
+ }
99
+ }
100
+ }
101
+ });
102
+ const {
103
+ withProvider,
104
+ withContext
105
+ } = (0, _createStyleContext.createStyleContext)(heroRecipe);
106
+ const Hero = exports.Hero = withProvider(_react.ark.div, "root", {
107
+ baseComponent: true
108
+ });
109
+ const HeroBackground = exports.HeroBackground = withContext(_react.ark.div, "background", {
110
+ baseComponent: true
111
+ });
112
+ const HeroContent = exports.HeroContent = withContext(_react.ark.div, "content", {
113
+ baseComponent: true
114
+ });
package/lib/index.d.ts CHANGED
@@ -31,6 +31,8 @@ export type { FigureSize, FigureVariantProps, FigureProps, FigureFloat } from ".
31
31
  export { Figure } from "./Figure";
32
32
  export type { FramedContentVariantProps, FramedContentProps } from "./FramedContent";
33
33
  export { FramedContent } from "./FramedContent";
34
+ export type { HeroVariantProps, HeroVariant, HeroProps, HeroBackgroundProps, HeroContentProps } from "./Hero";
35
+ export { Hero, HeroBackground, HeroContent } from "./Hero";
34
36
  export type { ImageCrop, ImageFocalPoint, PictureProps, ImgProps, ImageProps } from "./Image";
35
37
  export { Picture, Img, Image, makeSrcQueryString, getSrcSet } from "./Image";
36
38
  export { Input, FieldInput, InputContainer, TextArea, FieldTextArea } from "./Input";
package/lib/index.js CHANGED
@@ -333,6 +333,24 @@ Object.defineProperty(exports, "Heading", {
333
333
  return _Text.Heading;
334
334
  }
335
335
  });
336
+ Object.defineProperty(exports, "Hero", {
337
+ enumerable: true,
338
+ get: function () {
339
+ return _Hero.Hero;
340
+ }
341
+ });
342
+ Object.defineProperty(exports, "HeroBackground", {
343
+ enumerable: true,
344
+ get: function () {
345
+ return _Hero.HeroBackground;
346
+ }
347
+ });
348
+ Object.defineProperty(exports, "HeroContent", {
349
+ enumerable: true,
350
+ get: function () {
351
+ return _Hero.HeroContent;
352
+ }
353
+ });
336
354
  Object.defineProperty(exports, "IconButton", {
337
355
  enumerable: true,
338
356
  get: function () {
@@ -1014,6 +1032,7 @@ var _FieldErrorMessage = require("./FieldErrorMessage");
1014
1032
  var _FieldHelper = require("./FieldHelper");
1015
1033
  var _Figure = require("./Figure");
1016
1034
  var _FramedContent = require("./FramedContent");
1035
+ var _Hero = require("./Hero");
1017
1036
  var _Image = require("./Image");
1018
1037
  var _Input = require("./Input");
1019
1038
  var _Label = require("./Label");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/primitives",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "Primitive components for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -33,7 +33,7 @@
33
33
  "@ndla/util": "^4.1.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@ndla/preset-panda": "^0.0.11",
36
+ "@ndla/preset-panda": "^0.0.12",
37
37
  "@pandacss/dev": "^0.42.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "3675a902b9f44f5afb37c648038b8d90f1ccd7d0"
46
+ "gitHead": "557f718324916e39e3b04d6a7196679d31056e00"
47
47
  }