@oaknational/oak-components 0.4.0 → 0.5.1

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/types.d.ts CHANGED
@@ -8,7 +8,6 @@ import Image__default, { ImageProps as ImageProps$1 } from 'next/image';
8
8
  import * as next_dist_shared_lib_get_img_props from 'next/dist/shared/lib/get-img-props';
9
9
  import * as _cloudinary_util_url_loader_dist_schema_UX7RRFIR from '@cloudinary-util/url-loader/dist/schema-UX7RRFIR';
10
10
  import { CldImage } from 'next-cloudinary';
11
- import { DndContextProps } from '@dnd-kit/core';
12
11
  import { UrlObject } from 'url';
13
12
 
14
13
  declare const oakColorTokens: {
@@ -58,23 +57,6 @@ declare const oakColorTokens: {
58
57
  transparent: string;
59
58
  };
60
59
  type OakColorToken = keyof typeof oakColorTokens;
61
- /**
62
- *
63
- * Use this tool to convert Hex to color filter values https://codepen.io/sosuke/pen/Pjoqqp
64
- *
65
- */
66
- declare const oakColorFilterTokens: {
67
- black: string;
68
- red: string;
69
- oakGreen: string;
70
- white: string;
71
- grey40: string;
72
- grey50: string;
73
- navy: string;
74
- navy110: string;
75
- navy120: string;
76
- };
77
- type OakColorFilterToken = keyof typeof oakColorFilterTokens;
78
60
  declare const oakUiRoleTokens: readonly ["text-primary", "text-subdued", "text-error", "text-disabled", "text-link-active", "text-link-hover", "text-link-visited", "text-link-pressed", "text-inverted", "text-success", "text-warning", "bg-primary", "bg-neutral", "bg-neutral-stronger", "bg-btn-primary", "bg-btn-primary-hover", "bg-btn-primary-disabled", "bg-btn-secondary", "bg-btn-secondary-hover", "bg-btn-secondary-disabled", "bg-icon", "bg-icon-hover", "bg-decorative1-main", "bg-decorative1-subdued", "bg-decorative1-very-subdued", "bg-decorative2-main", "bg-decorative2-subdued", "bg-decorative2-very-subdued", "bg-decorative3-main", "bg-decorative3-subdued", "bg-decorative3-very-subdued", "bg-decorative4-main", "bg-decorative4-subdued", "bg-decorative4-very-subdued", "bg-decorative5-main", "bg-decorative5-subdued", "bg-decorative5-very-subdued", "bg-correct", "bg-incorrect", "icon-main", "icon-inverted", "icon-disabled", "icon-brand", "icon-success", "icon-error", "icon-warning", "border-primary", "border-inverted", "border-neutral", "border-brand", "border-success", "border-error", "border-warning", "border-decorative1", "border-decorative1-stronger", "border-decorative2", "border-decorative2-stronger", "border-decorative3", "border-decorative3-stronger", "border-decorative4", "border-decorative4-stronger", "border-decorative5", "border-decorative5-stronger", "border-decorative6", "border-decorative6-stronger", "transparent"];
79
61
  type OakUiRoleToken = (typeof oakUiRoleTokens)[number];
80
62
  type UiRoleMap = Record<OakUiRoleToken, OakColorToken | null | undefined>;
@@ -770,7 +752,7 @@ type FlexStyleProps = DisplayStyleProps & {
770
752
  *
771
753
  * Accepts a spacing token or a responsive array of spacing tokens. Can be nulled.
772
754
  */
773
- $flexBasis?: ResponsiveValues<OakAllSpacingToken | OakSpaceBetweenToken | null | undefined>;
755
+ $flexBasis?: ResponsiveValues<OakCombinedSpacingToken | null | undefined>;
774
756
  /**
775
757
  * Sets the `gap` CSS property of the element.
776
758
  *
@@ -814,7 +796,7 @@ declare const OakFlex: styled_components.StyledComponent<"div", styled_component
814
796
  $flexGrow?: ResponsiveValues<csstype.Property.FlexGrow | undefined>;
815
797
  $flexShrink?: ResponsiveValues<csstype.Property.FlexShrink | undefined>;
816
798
  $order?: ResponsiveValues<csstype.Property.Order | undefined>;
817
- $flexBasis?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
799
+ $flexBasis?: ResponsiveValues<OakCombinedSpacingToken | null | undefined>;
818
800
  $gap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
819
801
  $columnGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
820
802
  $rowGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
@@ -1006,7 +988,7 @@ declare const OakLI: styled_components.StyledComponent<"li", styled_components.D
1006
988
  $flexGrow?: ResponsiveValues<csstype.Property.FlexGrow | undefined>;
1007
989
  $flexShrink?: ResponsiveValues<csstype.Property.FlexShrink | undefined>;
1008
990
  $order?: ResponsiveValues<csstype.Property.Order | undefined>;
1009
- $flexBasis?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
991
+ $flexBasis?: ResponsiveValues<OakCombinedSpacingToken | null | undefined>;
1010
992
  $gap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1011
993
  $columnGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1012
994
  $rowGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
@@ -1285,17 +1267,10 @@ declare const OakGridArea: styled_components.StyledComponent<"div", styled_compo
1285
1267
  $flexGrow?: ResponsiveValues<csstype.Property.FlexGrow | undefined>;
1286
1268
  $flexShrink?: ResponsiveValues<csstype.Property.FlexShrink | undefined>;
1287
1269
  $order?: ResponsiveValues<csstype.Property.Order | undefined>;
1288
- $flexBasis?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1270
+ $flexBasis?: ResponsiveValues<OakCombinedSpacingToken | null | undefined>;
1289
1271
  $gap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1290
1272
  $columnGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1291
- $rowGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>; /**
1292
- *
1293
- * OakGridArea is a flex container that should be used inside OakGrid.
1294
- *
1295
- * - There is no nesting of OakGridAreas
1296
- * - Column and row arrangements are achieved through $colSpan, $rowSpan, $colStart, $colEnd, $rowStart, $rowEnd
1297
- *
1298
- */
1273
+ $rowGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1299
1274
  } & {
1300
1275
  /**
1301
1276
  * Determines the number of columns the element should span.
@@ -1367,7 +1342,7 @@ declare const OakMaxWidth: styled_components.StyledComponent<"div", styled_compo
1367
1342
  $flexGrow?: ResponsiveValues<csstype.Property.FlexGrow | undefined>;
1368
1343
  $flexShrink?: ResponsiveValues<csstype.Property.FlexShrink | undefined>;
1369
1344
  $order?: ResponsiveValues<csstype.Property.Order | undefined>;
1370
- $flexBasis?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1345
+ $flexBasis?: ResponsiveValues<OakCombinedSpacingToken | null | undefined>;
1371
1346
  $gap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1372
1347
  $columnGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
1373
1348
  $rowGap?: ResponsiveValues<"all-spacing-0" | "all-spacing-1" | "all-spacing-2" | "all-spacing-3" | "all-spacing-4" | "all-spacing-5" | "all-spacing-6" | "all-spacing-7" | "all-spacing-9" | "all-spacing-10" | "all-spacing-12" | "all-spacing-13" | "all-spacing-8" | "all-spacing-11" | "all-spacing-14" | "all-spacing-15" | "all-spacing-16" | "all-spacing-17" | "all-spacing-18" | "all-spacing-19" | "all-spacing-20" | "all-spacing-21" | "all-spacing-22" | "all-spacing-23" | "all-spacing-24" | "space-between-none" | "space-between-sssx" | "space-between-ssx" | "space-between-xs" | "space-between-s" | "space-between-m" | "space-between-m2" | "space-between-l" | "space-between-xl" | "space-between-xxl" | "space-between-xxxl" | null | undefined>;
@@ -1940,9 +1915,21 @@ type OakDraggableProps = {
1940
1915
  */
1941
1916
  iconName?: IconName;
1942
1917
  /**
1943
- * Icon color
1918
+ * Icon color when not being dragged or hovered
1919
+ */
1920
+ iconColor?: OakCombinedColorToken;
1921
+ /**
1922
+ * The alt text for the icon
1944
1923
  */
1945
- iconColor?: OakColorFilterToken;
1924
+ iconAlt?: string;
1925
+ /**
1926
+ * The background color of the draggable when not being dragged or hovered
1927
+ */
1928
+ background?: OakCombinedColorToken;
1929
+ /**
1930
+ * The color of the draggable when not being dragged or hovered
1931
+ */
1932
+ color?: OakCombinedColorToken;
1946
1933
  };
1947
1934
  /**
1948
1935
  * The component has no intrinsic draggable functionality.
@@ -1955,6 +1942,19 @@ type OakDroppableProps = {
1955
1942
  * Indicates whether a draggable is currently being dragged over the droppable
1956
1943
  */
1957
1944
  isOver?: boolean;
1945
+ /**
1946
+ * Present the element in a state making it clear that it can be dropped into
1947
+ */
1948
+ isDisabled?: boolean;
1949
+ /**
1950
+ * A slot for a label to be displayed to the RHS of the droppable
1951
+ *
1952
+ * useful for giving the user a hint about what to drop
1953
+ */
1954
+ labelSlot?: ReactNode;
1955
+ /**
1956
+ * A slot for the draggable that is currently occupying the droppable
1957
+ */
1958
1958
  children?: ReactNode;
1959
1959
  };
1960
1960
  /**
@@ -1963,7 +1963,7 @@ type OakDroppableProps = {
1963
1963
  * Has no intrinsic drop functionality.
1964
1964
  * It is intended to be used with `useDraggable` from `@dnd-kit/core`
1965
1965
  */
1966
- declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakBox>>;
1966
+ declare const OakDroppable: FC<OakDroppableProps & ComponentPropsWithRef<typeof OakFlex>>;
1967
1967
 
1968
1968
  type OakDraggableFeedbackProps = ComponentPropsWithoutRef<typeof OakDraggable> & {
1969
1969
  /**
@@ -2211,10 +2211,6 @@ type OakQuizOrderProps = {
2211
2211
  */
2212
2212
  onChange?: (items: OakQuizOrderItem[]) => void;
2213
2213
  };
2214
- /**
2215
- * Facilitates DI for the DndContext
2216
- */
2217
- declare const injectDndContext: React__default.Context<React__default.FC<DndContextProps>>;
2218
2214
  /**
2219
2215
  * A sortable list of items with drag and drop functionality. Items can be dragged over named slots to re-arrange them
2220
2216
  *
@@ -2222,6 +2218,46 @@ declare const injectDndContext: React__default.Context<React__default.FC<DndCont
2222
2218
  */
2223
2219
  declare const OakQuizOrder: ({ initialItems, onChange }: OakQuizOrderProps) => React__default.JSX.Element;
2224
2220
 
2221
+ type DraggableId = string;
2222
+ type DroppableId = string;
2223
+ type DraggableItem = {
2224
+ id: DraggableId;
2225
+ label: string;
2226
+ };
2227
+ type DroppableItem = {
2228
+ id: DroppableId;
2229
+ label: string;
2230
+ };
2231
+ type Matches = Record<DroppableId, DraggableItem>;
2232
+ type OakQuizMatchProps = {
2233
+ /**
2234
+ * The initial options
2235
+ *
2236
+ * these are the items that can be dragged into a slot to form a match
2237
+ *
2238
+ * this cannot be updated on subsequent renders
2239
+ */
2240
+ initialOptions: DraggableItem[];
2241
+ /**
2242
+ * The initial slots
2243
+ *
2244
+ * these are the slots into which an option can be dropped to form a match
2245
+ *
2246
+ * this cannot be updated on subsequent renders
2247
+ */
2248
+ initialSlots: DroppableItem[];
2249
+ /**
2250
+ * Notify the consumer when matches have changed
2251
+ */
2252
+ onChange?: (matches: Matches) => void;
2253
+ };
2254
+ /**
2255
+ * A list of draggable items with matching slots to drop them into.
2256
+ *
2257
+ * Keyboard navigation is supported with the `tab`, `space` and `arrow` keys
2258
+ */
2259
+ declare const OakQuizMatch: ({ initialOptions, initialSlots, onChange, }: OakQuizMatchProps) => React__default.JSX.Element;
2260
+
2225
2261
  type OakSubjectIconProps = Pick<OakHandDrawnBoxWithIconProps, "iconName" | "fill" | "iconColor" | "alt"> & {
2226
2262
  iconName: `subject-${string}`;
2227
2263
  showPromoTag?: boolean;
@@ -2257,4 +2293,4 @@ type OakPrimaryNavProps = {
2257
2293
  */
2258
2294
  declare const OakPrimaryNav: ({ ariaLabel, navItems }: OakPrimaryNavProps) => React__default.JSX.Element;
2259
2295
 
2260
- export { HeadingTagComponent, type OakAllSpacingToken, OakBackLink, type OakBackLinkProps, type OakBorderRadiusToken, type OakBorderWidthToken, OakBox, type OakBoxProps, OakBulletList, type OakBulletListProps, OakCardHeader, type OakCardHeaderprops, OakCheckBox, type OakCheckBoxProps, OakCloudinaryConfigProvider, OakCloudinaryImage, type OakCloudinaryImageProps, OakCollapsibleContent, type OakCollapsibleContentProps, type OakColorToken, type OakCombinedColorToken, type OakCombinedSpacingToken, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, type OakDropShadowToken, OakDroppable, type OakDroppableProps, OakFieldError, type OakFieldErrorProps, OakFlex, type OakFlexProps, type OakFontSizeToken, type OakFontToken, OakForm, type OakFormProps, OakGlobalStyle, OakGrid, OakGridArea, type OakGridAreaProps, type OakGridProps, type OakHandDrawnBoxWithIconProps, OakHandDrawnCard, type OakHandDrawnCardProps, OakHandDrawnCardWithIcon, OakHeading, type OakHeadingProps, type OakHeadingTag, OakHintButton, type OakHintButtonProps, OakIcon, type OakIconName, type OakIconProps, OakImage, type OakImageProps, type OakInfoCardProps, type OakInnerPaddingToken, OakKbd, type OakKbdProps, OakLI, type OakLIProps, OakLabel, type OakLabelProps, OakLessonBottomNav, type OakLessonBottomNavProps, OakLessonInfoCard, OakLessonLayout, type OakLessonLayoutProps, OakLessonNavItem, type OakLessonNavItemProps, OakLessonReviewItem, type OakLessonReviewItemProps, OakLessonTopNav, type OakLessonTopNavProps, OakLessonVideoTranscript, OakLink, type OakLinkProps, OakLoadingSpinner, type OakLoadingSpinnerProps, OakMaxWidth, OakOL, type OakOLProps, type OakOpacityToken, OakP, type OakPProps, OakPrimaryButton, type OakPrimaryButtonProps, OakPrimaryInvertedButton, type OakPrimaryInvertedButtonProps, OakPrimaryNav, OakPrimaryNavItem, type OakPrimaryNavItemProps, type OakPrimaryNavProps, OakPromoTag, OakQuizCheckBox, type OakQuizCheckBoxProps, OakQuizCounter, type OakQuizCounterProps, OakQuizFeedback, type OakQuizFeedbackProps, OakQuizHint, type OakQuizHintProps, OakQuizOrder, type OakQuizOrderProps, OakQuizRadioButton, type OakQuizRadioButtonProps, OakQuizTextInput, OakRadioButton, OakRadioGroup, OakRoundIcon, type OakRoundIconProps, OakSecondaryButton, type OakSecondaryButtonProps, type OakSpaceBetweenToken, OakSpan, type OakSpanProps, OakStaticMessageCard, OakSubjectIcon, type OakSubjectIconProps, OakTertiaryButton, OakTextInput, type OakTextInputProps, type OakTheme, OakThemeProvider, type OakThemeProviderProps, OakTooltip, type OakTransitionToken, OakTypography, type OakTypographyProps, OakUL, type OakULProps, type OakUiRoleToken, injectDndContext, isValidIconName, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDefaultTheme, oakDropShadowTokens, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakInnerPaddingTokens, oakOpacityTokens, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens };
2296
+ export { HeadingTagComponent, type OakAllSpacingToken, OakBackLink, type OakBackLinkProps, type OakBorderRadiusToken, type OakBorderWidthToken, OakBox, type OakBoxProps, OakBulletList, type OakBulletListProps, OakCardHeader, type OakCardHeaderprops, OakCheckBox, type OakCheckBoxProps, OakCloudinaryConfigProvider, OakCloudinaryImage, type OakCloudinaryImageProps, OakCollapsibleContent, type OakCollapsibleContentProps, type OakColorToken, type OakCombinedColorToken, type OakCombinedSpacingToken, OakDragAndDropInstructions, OakDraggable, OakDraggableFeedback, type OakDropShadowToken, OakDroppable, type OakDroppableProps, OakFieldError, type OakFieldErrorProps, OakFlex, type OakFlexProps, type OakFontSizeToken, type OakFontToken, OakForm, type OakFormProps, OakGlobalStyle, OakGrid, OakGridArea, type OakGridAreaProps, type OakGridProps, type OakHandDrawnBoxWithIconProps, OakHandDrawnCard, type OakHandDrawnCardProps, OakHandDrawnCardWithIcon, OakHeading, type OakHeadingProps, type OakHeadingTag, OakHintButton, type OakHintButtonProps, OakIcon, type OakIconName, type OakIconProps, OakImage, type OakImageProps, type OakInfoCardProps, type OakInnerPaddingToken, OakKbd, type OakKbdProps, OakLI, type OakLIProps, OakLabel, type OakLabelProps, OakLessonBottomNav, type OakLessonBottomNavProps, OakLessonInfoCard, OakLessonLayout, type OakLessonLayoutProps, OakLessonNavItem, type OakLessonNavItemProps, OakLessonReviewItem, type OakLessonReviewItemProps, OakLessonTopNav, type OakLessonTopNavProps, OakLessonVideoTranscript, OakLink, type OakLinkProps, OakLoadingSpinner, type OakLoadingSpinnerProps, OakMaxWidth, OakOL, type OakOLProps, type OakOpacityToken, OakP, type OakPProps, OakPrimaryButton, type OakPrimaryButtonProps, OakPrimaryInvertedButton, type OakPrimaryInvertedButtonProps, OakPrimaryNav, OakPrimaryNavItem, type OakPrimaryNavItemProps, type OakPrimaryNavProps, OakPromoTag, OakQuizCheckBox, type OakQuizCheckBoxProps, OakQuizCounter, type OakQuizCounterProps, OakQuizFeedback, type OakQuizFeedbackProps, OakQuizHint, type OakQuizHintProps, OakQuizMatch, type OakQuizMatchProps, OakQuizOrder, type OakQuizOrderProps, OakQuizRadioButton, type OakQuizRadioButtonProps, OakQuizTextInput, OakRadioButton, OakRadioGroup, OakRoundIcon, type OakRoundIconProps, OakSecondaryButton, type OakSecondaryButtonProps, type OakSpaceBetweenToken, OakSpan, type OakSpanProps, OakStaticMessageCard, OakSubjectIcon, type OakSubjectIconProps, OakTertiaryButton, OakTextInput, type OakTextInputProps, type OakTheme, OakThemeProvider, type OakThemeProviderProps, OakTooltip, type OakTransitionToken, OakTypography, type OakTypographyProps, OakUL, type OakULProps, type OakUiRoleToken, isValidIconName, oakAllSpacingTokens, oakBorderRadiusTokens, oakBorderWidthTokens, oakBoxCss, oakColorTokens, oakDefaultTheme, oakDropShadowTokens, oakFontSizeTokens, oakFontTokens, oakHeadingTags, oakIconNames, oakInnerPaddingTokens, oakOpacityTokens, oakSpaceBetweenTokens, oakTransitionTokens, oakUiRoleTokens };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oaknational/oak-components",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "licence": "MIT",
5
5
  "description": "Shared components for Oak applications",
6
6
  "main": "dist/cjs/index.js",