@ornikar/bumper 3.11.0 → 3.12.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.
- package/CHANGELOG.md +11 -0
- package/dist/definitions/index.d.ts +2 -0
- package/dist/definitions/index.d.ts.map +1 -1
- package/dist/definitions/system/dataDisplays/Sticker/Sticker.d.ts +18 -0
- package/dist/definitions/system/dataDisplays/Sticker/Sticker.d.ts.map +1 -0
- package/dist/definitions/system/dataDisplays/Sticker/components/StickerLabel.d.ts +7 -0
- package/dist/definitions/system/dataDisplays/Sticker/components/StickerLabel.d.ts.map +1 -0
- package/dist/definitions/system/dataDisplays/Sticker/context.d.ts +3 -0
- package/dist/definitions/system/dataDisplays/Sticker/context.d.ts.map +1 -0
- package/dist/definitions/system/dataDisplays/Sticker/types.d.ts +24 -0
- package/dist/definitions/system/dataDisplays/Sticker/types.d.ts.map +1 -0
- package/dist/definitions/system/layout/divider/Divider.d.ts.map +1 -1
- package/dist/definitions/system/types.d.ts +10 -9
- package/dist/definitions/system/types.d.ts.map +1 -1
- package/dist/index-metro.es.android.js +146 -9
- package/dist/index-metro.es.android.js.map +1 -1
- package/dist/index-metro.es.ios.js +146 -9
- package/dist/index-metro.es.ios.js.map +1 -1
- package/dist/index-node-22.22.cjs.js +145 -6
- package/dist/index-node-22.22.cjs.js.map +1 -1
- package/dist/index-node-22.22.cjs.web.js +145 -6
- package/dist/index-node-22.22.cjs.web.js.map +1 -1
- package/dist/index-node-22.22.es.mjs +145 -7
- package/dist/index-node-22.22.es.mjs.map +1 -1
- package/dist/index-node-22.22.es.web.mjs +145 -7
- package/dist/index-node-22.22.es.web.mjs.map +1 -1
- package/dist/index.es.js +141 -9
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +141 -9
- package/dist/index.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/docs/migration/Sticker.md +222 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/system/dataDisplays/Sticker/Sticker.features.stories.tsx +50 -0
- package/src/system/dataDisplays/Sticker/Sticker.mdx +38 -0
- package/src/system/dataDisplays/Sticker/Sticker.stories.tsx +49 -0
- package/src/system/dataDisplays/Sticker/Sticker.tsx +52 -0
- package/src/system/dataDisplays/Sticker/__snapshots__/Sticker.features.stories.tsx.snap +747 -0
- package/src/system/dataDisplays/Sticker/__snapshots__/Sticker.stories.tsx.snap +52 -0
- package/src/system/dataDisplays/Sticker/__snapshots_web__/Sticker.features.stories.tsx.snap +294 -0
- package/src/system/dataDisplays/Sticker/__snapshots_web__/Sticker.stories.tsx.snap +35 -0
- package/src/system/dataDisplays/Sticker/components/StickerLabel.tsx +33 -0
- package/src/system/dataDisplays/Sticker/context.ts +10 -0
- package/src/system/dataDisplays/Sticker/types.ts +61 -0
- package/src/system/layout/divider/Divider.tsx +7 -2
- package/src/system/layout/divider/__snapshots_web__/Divider.features.stories.tsx.snap +7 -0
- package/src/system/layout/divider/__snapshots_web__/Divider.stories.tsx.snap +1 -0
- package/src/system/types.ts +26 -14
|
@@ -476,7 +476,7 @@ const Center = styled(View, {
|
|
|
476
476
|
alignItems: 'center'
|
|
477
477
|
});
|
|
478
478
|
|
|
479
|
-
const _excluded = ["as"];
|
|
479
|
+
const _excluded$1 = ["as"];
|
|
480
480
|
/**
|
|
481
481
|
* A polymorphic Pressable component that can render as any Tamagui primitive.
|
|
482
482
|
*/
|
|
@@ -484,7 +484,7 @@ function Pressable(_ref) {
|
|
|
484
484
|
let {
|
|
485
485
|
as
|
|
486
486
|
} = _ref,
|
|
487
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
487
|
+
rest = _objectWithoutProperties(_ref, _excluded$1);
|
|
488
488
|
const Component = styled(as !== null && as !== void 0 ? as : View, {
|
|
489
489
|
name: 'Pressable',
|
|
490
490
|
role: 'button',
|
|
@@ -834,7 +834,7 @@ function Icon(props) {
|
|
|
834
834
|
return /*#__PURE__*/jsx(InternalIcon, _objectSpread({}, props));
|
|
835
835
|
}
|
|
836
836
|
|
|
837
|
-
const context = createStyledContext({
|
|
837
|
+
const context$1 = createStyledContext({
|
|
838
838
|
size: 'large',
|
|
839
839
|
type: 'secondary',
|
|
840
840
|
isOnContrasted: false,
|
|
@@ -866,7 +866,7 @@ function ButtonIcon({
|
|
|
866
866
|
type,
|
|
867
867
|
disabled,
|
|
868
868
|
isOnContrasted
|
|
869
|
-
} = context.useStyledContext();
|
|
869
|
+
} = context$1.useStyledContext();
|
|
870
870
|
const color = getButtonContentColor(type, disabled, isOnContrasted);
|
|
871
871
|
return /*#__PURE__*/jsx(Icon, {
|
|
872
872
|
icon: icon,
|
|
@@ -953,7 +953,7 @@ function ButtonText({
|
|
|
953
953
|
size,
|
|
954
954
|
disabled,
|
|
955
955
|
isOnContrasted
|
|
956
|
-
} = context.useStyledContext();
|
|
956
|
+
} = context$1.useStyledContext();
|
|
957
957
|
const color = getButtonContentColor(type, disabled, isOnContrasted);
|
|
958
958
|
return /*#__PURE__*/jsxs(VStack, {
|
|
959
959
|
children: [/*#__PURE__*/jsx(Typography.Text, {
|
|
@@ -970,7 +970,7 @@ function ButtonText({
|
|
|
970
970
|
|
|
971
971
|
const InternalButtonFrame = styled(HStack, {
|
|
972
972
|
name: 'Button',
|
|
973
|
-
context,
|
|
973
|
+
context: context$1,
|
|
974
974
|
role: 'button',
|
|
975
975
|
alignItems: 'center',
|
|
976
976
|
justifyContent: 'center',
|
|
@@ -991,7 +991,7 @@ const InternalButtonFrame = styled(HStack, {
|
|
|
991
991
|
const {
|
|
992
992
|
isOnContrasted,
|
|
993
993
|
disabled
|
|
994
|
-
} = context.useStyledContext();
|
|
994
|
+
} = context$1.useStyledContext();
|
|
995
995
|
const commonTypeStyle = {
|
|
996
996
|
backgroundColor: `$button.bg.${type}${isOnContrasted ? '.onContrasted' : ''}.default`,
|
|
997
997
|
hoverStyle: {
|
|
@@ -1112,7 +1112,7 @@ const Button = withStaticProperties(InternalButton, {
|
|
|
1112
1112
|
|
|
1113
1113
|
const InternalIconButtonFrame = styled(InternalButton, {
|
|
1114
1114
|
name: 'IconButton',
|
|
1115
|
-
context,
|
|
1115
|
+
context: context$1,
|
|
1116
1116
|
variants: {
|
|
1117
1117
|
size: {
|
|
1118
1118
|
small: {
|
|
@@ -1138,6 +1138,143 @@ const IconButton = withStaticProperties(InternalIconButton, {
|
|
|
1138
1138
|
Badge: ButtonBadge
|
|
1139
1139
|
});
|
|
1140
1140
|
|
|
1141
|
+
const context = createStyledContext({
|
|
1142
|
+
color: 'green',
|
|
1143
|
+
size: 'small',
|
|
1144
|
+
disabled: false
|
|
1145
|
+
});
|
|
1146
|
+
|
|
1147
|
+
/* eslint-disable @ornikar/kitt/prefer-semantic-tokens --
|
|
1148
|
+
* Sticker intentionally exposes 12 palette-level decorative colors agreed with design.
|
|
1149
|
+
*/
|
|
1150
|
+
const STICKER_COLORS = {
|
|
1151
|
+
green: {
|
|
1152
|
+
background: '$palette.rainbow.green-grass',
|
|
1153
|
+
text: '$palette.rainbow.green-apple'
|
|
1154
|
+
},
|
|
1155
|
+
greenDark: {
|
|
1156
|
+
background: '$palette.rainbow.green-pine',
|
|
1157
|
+
text: '$palette.rainbow.blue-sky'
|
|
1158
|
+
},
|
|
1159
|
+
blue: {
|
|
1160
|
+
background: '$palette.rainbow.blue-sky',
|
|
1161
|
+
text: '$palette.rainbow.green-pine'
|
|
1162
|
+
},
|
|
1163
|
+
blueDark: {
|
|
1164
|
+
background: '$palette.rainbow.blue-electric',
|
|
1165
|
+
text: '$palette.beige.3'
|
|
1166
|
+
},
|
|
1167
|
+
red: {
|
|
1168
|
+
background: '$palette.rainbow.brick',
|
|
1169
|
+
text: '$palette.rainbow.sun'
|
|
1170
|
+
},
|
|
1171
|
+
orange: {
|
|
1172
|
+
background: '$palette.rainbow.orange',
|
|
1173
|
+
text: '$palette.beige.2'
|
|
1174
|
+
},
|
|
1175
|
+
pink: {
|
|
1176
|
+
background: '$palette.rainbow.pink',
|
|
1177
|
+
text: '$palette.rainbow.brick'
|
|
1178
|
+
},
|
|
1179
|
+
gold: {
|
|
1180
|
+
background: '$palette.rainbow.gold',
|
|
1181
|
+
text: '$palette.beige.1'
|
|
1182
|
+
},
|
|
1183
|
+
cream: {
|
|
1184
|
+
background: '$palette.beige.1',
|
|
1185
|
+
text: '$palette.rainbow.brick'
|
|
1186
|
+
},
|
|
1187
|
+
linen: {
|
|
1188
|
+
background: '$palette.beige.3',
|
|
1189
|
+
text: '$palette.deepPurple.8'
|
|
1190
|
+
},
|
|
1191
|
+
lightning: {
|
|
1192
|
+
background: '$palette.lightning.5',
|
|
1193
|
+
text: '$palette.lightning.9'
|
|
1194
|
+
},
|
|
1195
|
+
lightningDark: {
|
|
1196
|
+
background: '$palette.lightning.9',
|
|
1197
|
+
text: '$palette.lightning.5'
|
|
1198
|
+
},
|
|
1199
|
+
disabled: {
|
|
1200
|
+
background: '$bg.disabled.hi',
|
|
1201
|
+
text: '$content.disabled.onContrasted'
|
|
1202
|
+
}
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1205
|
+
const TYPOGRAPHY_VARIANT_BY_SIZE = {
|
|
1206
|
+
small: 'content-caps-xs',
|
|
1207
|
+
medium: 'content-caps-m',
|
|
1208
|
+
large: 'content-caps-l'
|
|
1209
|
+
};
|
|
1210
|
+
function InternalStickerLabel({
|
|
1211
|
+
children
|
|
1212
|
+
}) {
|
|
1213
|
+
const {
|
|
1214
|
+
color,
|
|
1215
|
+
size,
|
|
1216
|
+
disabled
|
|
1217
|
+
} = context.useStyledContext();
|
|
1218
|
+
const textColor = STICKER_COLORS[disabled ? 'disabled' : color].text;
|
|
1219
|
+
return /*#__PURE__*/jsx(InternalTypography, {
|
|
1220
|
+
variant: TYPOGRAPHY_VARIANT_BY_SIZE[size],
|
|
1221
|
+
color: textColor,
|
|
1222
|
+
numberOfLines: 1,
|
|
1223
|
+
ellipsizeMode: "tail",
|
|
1224
|
+
children: children
|
|
1225
|
+
});
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
const _excluded = ["label"];
|
|
1229
|
+
const InternalStickerFrame = styled(View, {
|
|
1230
|
+
name: 'Sticker',
|
|
1231
|
+
context,
|
|
1232
|
+
alignSelf: 'flex-start',
|
|
1233
|
+
maxWidth: '100%',
|
|
1234
|
+
padding: '$space.4',
|
|
1235
|
+
variants: {
|
|
1236
|
+
label: {},
|
|
1237
|
+
size: {
|
|
1238
|
+
small: {
|
|
1239
|
+
borderRadius: '$radius.s'
|
|
1240
|
+
},
|
|
1241
|
+
medium: {
|
|
1242
|
+
borderRadius: '$radius.m'
|
|
1243
|
+
},
|
|
1244
|
+
large: {
|
|
1245
|
+
borderRadius: '$radius.m'
|
|
1246
|
+
}
|
|
1247
|
+
},
|
|
1248
|
+
color: color => {
|
|
1249
|
+
const {
|
|
1250
|
+
disabled
|
|
1251
|
+
} = context.useStyledContext();
|
|
1252
|
+
return {
|
|
1253
|
+
backgroundColor: STICKER_COLORS[disabled ? 'disabled' : color].background
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
defaultVariants: {
|
|
1258
|
+
size: 'small',
|
|
1259
|
+
color: 'green'
|
|
1260
|
+
}
|
|
1261
|
+
});
|
|
1262
|
+
const InternalSticker = InternalStickerFrame.styleable(props => {
|
|
1263
|
+
const _useProps = useProps(props),
|
|
1264
|
+
{
|
|
1265
|
+
label
|
|
1266
|
+
} = _useProps,
|
|
1267
|
+
frameProps = _objectWithoutProperties(_useProps, _excluded);
|
|
1268
|
+
return /*#__PURE__*/jsx(InternalStickerFrame, _objectSpread(_objectSpread({}, frameProps), {}, {
|
|
1269
|
+
children: /*#__PURE__*/jsx(InternalStickerLabel, {
|
|
1270
|
+
children: label
|
|
1271
|
+
})
|
|
1272
|
+
}));
|
|
1273
|
+
});
|
|
1274
|
+
function Sticker(props) {
|
|
1275
|
+
return /*#__PURE__*/jsx(InternalSticker, _objectSpread({}, props));
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1141
1278
|
function getValueForBreakpoint(breakpoint, {
|
|
1142
1279
|
base,
|
|
1143
1280
|
small,
|
|
@@ -1190,5 +1327,5 @@ function SwitchBreakpoints(values) {
|
|
|
1190
1327
|
return getValueForBreakpoint(breakpoint, values);
|
|
1191
1328
|
}
|
|
1192
1329
|
|
|
1193
|
-
export { Badge, BumperProvider, Button, Center, HStack, IconButton, Loader, Pressable, SwitchBreakpoints, Typography, VStack, getValueForBreakpoint, useBreakpointValue, useCurrentBreakpointName };
|
|
1330
|
+
export { Badge, BumperProvider, Button, Center, HStack, IconButton, Loader, Pressable, Sticker, SwitchBreakpoints, Typography, VStack, getValueForBreakpoint, useBreakpointValue, useCurrentBreakpointName };
|
|
1194
1331
|
//# sourceMappingURL=index-metro.es.ios.js.map
|