@storybook/types 8.0.7 → 8.0.9

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +113 -3
  2. package/package.json +3 -3
package/dist/index.d.ts CHANGED
@@ -1024,6 +1024,7 @@ interface StoryIdentifier {
1024
1024
  interface Parameters {
1025
1025
  [name: string]: any;
1026
1026
  }
1027
+ type ControlType = 'object' | 'boolean' | 'check' | 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select' | 'number' | 'range' | 'file' | 'color' | 'date' | 'text';
1027
1028
  type ConditionalTest = {
1028
1029
  truthy?: boolean;
1029
1030
  } | {
@@ -1039,12 +1040,118 @@ type ConditionalValue = {
1039
1040
  global: string;
1040
1041
  };
1041
1042
  type Conditional = ConditionalValue & ConditionalTest;
1043
+ interface ControlBase {
1044
+ [key: string]: any;
1045
+ /**
1046
+ * @see https://storybook.js.org/docs/api/arg-types#controltype
1047
+ */
1048
+ type?: ControlType;
1049
+ disable?: boolean;
1050
+ }
1051
+ type Control = ControlType | false | (ControlBase & (ControlBase | {
1052
+ type: 'color';
1053
+ /**
1054
+ * @see https://storybook.js.org/docs/api/arg-types#controlpresetcolors
1055
+ */
1056
+ presetColors?: string[];
1057
+ } | {
1058
+ type: 'file';
1059
+ /**
1060
+ * @see https://storybook.js.org/docs/api/arg-types#controlaccept
1061
+ */
1062
+ accept?: string;
1063
+ } | {
1064
+ type: 'inline-check' | 'radio' | 'inline-radio' | 'select' | 'multi-select';
1065
+ /**
1066
+ * @see https://storybook.js.org/docs/api/arg-types#controllabels
1067
+ */
1068
+ labels?: {
1069
+ [options: string]: string;
1070
+ };
1071
+ } | {
1072
+ type: 'number' | 'range';
1073
+ /**
1074
+ * @see https://storybook.js.org/docs/api/arg-types#controlmax
1075
+ */
1076
+ max?: number;
1077
+ /**
1078
+ * @see https://storybook.js.org/docs/api/arg-types#controlmin
1079
+ */
1080
+ min?: number;
1081
+ /**
1082
+ * @see https://storybook.js.org/docs/api/arg-types#controlstep
1083
+ */
1084
+ step?: number;
1085
+ }));
1042
1086
  interface InputType {
1043
- name?: string;
1087
+ /**
1088
+ * @see https://storybook.js.org/docs/api/arg-types#control
1089
+ */
1090
+ control?: Control;
1091
+ /**
1092
+ * @see https://storybook.js.org/docs/api/arg-types#description
1093
+ */
1044
1094
  description?: string;
1045
- defaultValue?: any;
1046
- type?: SBType | SBScalarType['name'];
1095
+ /**
1096
+ * @see https://storybook.js.org/docs/api/arg-types#if
1097
+ */
1047
1098
  if?: Conditional;
1099
+ /**
1100
+ * @see https://storybook.js.org/docs/api/arg-types#mapping
1101
+ */
1102
+ mapping?: {
1103
+ [key: string]: any;
1104
+ };
1105
+ /**
1106
+ * @see https://storybook.js.org/docs/api/arg-types#name
1107
+ */
1108
+ name?: string;
1109
+ /**
1110
+ * @see https://storybook.js.org/docs/api/arg-types#options
1111
+ */
1112
+ options?: any[];
1113
+ /**
1114
+ * @see https://storybook.js.org/docs/api/arg-types#table
1115
+ */
1116
+ table?: {
1117
+ [key: string]: unknown;
1118
+ /**
1119
+ * @see https://storybook.js.org/docs/api/arg-types#tablecategory
1120
+ */
1121
+ category?: string;
1122
+ /**
1123
+ * @see https://storybook.js.org/docs/api/arg-types#tabledefaultvalue
1124
+ */
1125
+ defaultValue?: {
1126
+ summary?: string;
1127
+ detail?: string;
1128
+ };
1129
+ /**
1130
+ * @see https://storybook.js.org/docs/api/arg-types#tabledisable
1131
+ */
1132
+ disable?: boolean;
1133
+ /**
1134
+ * @see https://storybook.js.org/docs/api/arg-types#tablesubcategory
1135
+ */
1136
+ subcategory?: string;
1137
+ /**
1138
+ * @see https://storybook.js.org/docs/api/arg-types#tabletype
1139
+ */
1140
+ type?: {
1141
+ summary?: string;
1142
+ detail?: string;
1143
+ };
1144
+ };
1145
+ /**
1146
+ * @see https://storybook.js.org/docs/api/arg-types#type
1147
+ */
1148
+ type?: SBType | SBScalarType['name'];
1149
+ /**
1150
+ * @see https://storybook.js.org/docs/api/arg-types#defaultvalue
1151
+ *
1152
+ * @deprecated Use `table.defaultValue.summary` instead.
1153
+ */
1154
+ defaultValue?: any;
1048
1155
  [key: string]: any;
1049
1156
  }
1050
1157
  interface StrictInputType extends InputType {
@@ -1057,6 +1164,9 @@ interface Args {
1057
1164
  interface StrictArgs {
1058
1165
  [name: string]: unknown;
1059
1166
  }
1167
+ /**
1168
+ * @see https://storybook.js.org/docs/api/arg-types#argtypes
1169
+ */
1060
1170
  type ArgTypes<TArgs = Args> = {
1061
1171
  [name in keyof TArgs]: InputType;
1062
1172
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/types",
3
- "version": "8.0.7",
3
+ "version": "8.0.9",
4
4
  "description": "Core Storybook TS Types",
5
5
  "keywords": [
6
6
  "storybook"
@@ -44,12 +44,12 @@
44
44
  "prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
45
45
  },
46
46
  "dependencies": {
47
- "@storybook/channels": "8.0.7",
47
+ "@storybook/channels": "8.0.9",
48
48
  "@types/express": "^4.7.0",
49
49
  "file-system-cache": "2.3.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@storybook/csf": "^0.1.2",
52
+ "@storybook/csf": "^0.1.4",
53
53
  "@types/fs-extra": "^11.0.1",
54
54
  "@types/node": "^18.0.0",
55
55
  "typescript": "^5.3.2"