@butternutbox/pawprint-native 0.24.3 → 0.25.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.
@@ -7,12 +7,12 @@
7
7
  CJS Build start
8
8
  ESM Build start
9
9
  DTS Build start
10
- CJS dist/index.cjs 554.62 KB
10
+ CJS dist/index.cjs 555.31 KB
11
11
  CJS dist/index.cjs.map 1.08 MB
12
- CJS ⚡️ Build success in 7745ms
13
- ESM dist/index.js 523.98 KB
12
+ CJS ⚡️ Build success in 8617ms
13
+ ESM dist/index.js 524.64 KB
14
14
  ESM dist/index.js.map 1.08 MB
15
- ESM ⚡️ Build success in 7749ms
16
- DTS ⚡️ Build success in 22188ms
17
- DTS dist/index.d.cts 103.19 KB
18
- DTS dist/index.d.ts 103.19 KB
15
+ ESM ⚡️ Build success in 8621ms
16
+ DTS ⚡️ Build success in 23481ms
17
+ DTS dist/index.d.cts 103.29 KB
18
+ DTS dist/index.d.ts 103.29 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @butternutbox/pawprint-native
2
2
 
3
+ ## 0.25.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 225f6c1: Allow custom date headers to be passed into date picker
8
+
9
+ ## 0.25.0
10
+
11
+ ### Minor Changes
12
+
13
+ - d616d1f: allow custom month labels on the date picker
14
+
15
+ ### Patch Changes
16
+
17
+ - 61284fb: Update SelectFieldValue to reflect current value state
18
+
3
19
  ## 0.24.3
4
20
 
5
21
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1300,6 +1300,16 @@ var Button = React66__default.default.forwardRef(
1300
1300
  };
1301
1301
  };
1302
1302
  const variantStyles = getVariantStyles(pressed);
1303
+ const renderIcon = (icon) => {
1304
+ if (!React66__default.default.isValidElement(icon)) return icon;
1305
+ const iconElement = icon;
1306
+ if (!pressed) {
1307
+ return icon;
1308
+ }
1309
+ return React66__default.default.cloneElement(iconElement, {
1310
+ customColour: variantStyles.textColor
1311
+ });
1312
+ };
1303
1313
  return /* @__PURE__ */ jsxRuntime.jsxs(
1304
1314
  StyledButton,
1305
1315
  __spreadProps(__spreadValues({
@@ -1323,7 +1333,7 @@ var Button = React66__default.default.forwardRef(
1323
1333
  buttonFullWidth: fullWidth
1324
1334
  }, rest), {
1325
1335
  children: [
1326
- startIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: startIcon }),
1336
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: renderIcon(startIcon) }),
1327
1337
  /* @__PURE__ */ jsxRuntime.jsx(
1328
1338
  Typography,
1329
1339
  {
@@ -1339,7 +1349,7 @@ var Button = React66__default.default.forwardRef(
1339
1349
  children
1340
1350
  }
1341
1351
  ),
1342
- endIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: endIcon }),
1352
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx(IconWrapper, { children: renderIcon(endIcon) }),
1343
1353
  loading && /* @__PURE__ */ jsxRuntime.jsx(StyledSpinnerWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(
1344
1354
  Spinner,
1345
1355
  {
@@ -8890,14 +8900,14 @@ var SelectFieldTrigger = React66__default.default.forwardRef(
8890
8900
  SelectFieldTrigger.displayName = "SelectField.Trigger";
8891
8901
  var SelectFieldValue = React66__default.default.forwardRef(
8892
8902
  (_a, ref) => {
8893
- var _b = _a, { placeholder } = _b, rest = __objRest(_b, ["placeholder"]);
8903
+ var _b = _a, { placeholder, hasValue = true } = _b, rest = __objRest(_b, ["placeholder", "hasValue"]);
8894
8904
  const theme2 = react.useTheme();
8895
8905
  const { colour, field } = theme2.tokens.components.inputs;
8896
8906
  return /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, __spreadProps(__spreadValues({ ref, style: { flex: 1, minWidth: 0 } }, rest), { children: /* @__PURE__ */ jsxRuntime.jsx(
8897
8907
  Typography,
8898
8908
  {
8899
8909
  token: field.placeholder.default,
8900
- color: colour.field.text.default,
8910
+ color: hasValue ? colour.field.text.default : colour.field.text.placeholder,
8901
8911
  align: "left",
8902
8912
  children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive3__namespace.Value, { placeholder: placeholder != null ? placeholder : "" })
8903
8913
  }
@@ -9274,7 +9284,13 @@ var SelectFieldRoot = React66__default.default.forwardRef(
9274
9284
  clearButtonMode: "never",
9275
9285
  accessibilityLabel: "Search options"
9276
9286
  }
9277
- ) : /* @__PURE__ */ jsxRuntime.jsx(SelectFieldValue, { placeholder })
9287
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
9288
+ SelectFieldValue,
9289
+ {
9290
+ placeholder,
9291
+ hasValue: Boolean(currentValue)
9292
+ }
9293
+ )
9278
9294
  }
9279
9295
  ),
9280
9296
  description && /* @__PURE__ */ jsxRuntime.jsx(InputDescription, { state, children: description }),
@@ -11150,6 +11166,7 @@ var DatePicker = React66__default.default.forwardRef(
11150
11166
  showNextControl = true,
11151
11167
  locale,
11152
11168
  monthLabel,
11169
+ getMonthLabel,
11153
11170
  weekDayLabels = DEFAULT_WEEK_LABELS,
11154
11171
  getDateState,
11155
11172
  isDateDisabled,
@@ -11169,12 +11186,14 @@ var DatePicker = React66__default.default.forwardRef(
11169
11186
  "showNextControl",
11170
11187
  "locale",
11171
11188
  "monthLabel",
11189
+ "getMonthLabel",
11172
11190
  "weekDayLabels",
11173
11191
  "getDateState",
11174
11192
  "isDateDisabled",
11175
11193
  "minDate",
11176
11194
  "maxDate"
11177
11195
  ]);
11196
+ var _a2;
11178
11197
  const theme2 = react.useTheme();
11179
11198
  const { datePicker } = theme2.tokens.components;
11180
11199
  const dt = datePicker.dateItem;
@@ -11209,8 +11228,8 @@ var DatePicker = React66__default.default.forwardRef(
11209
11228
  );
11210
11229
  const resolvedGetDateState = React66.useCallback(
11211
11230
  (date) => {
11212
- var _a2;
11213
- return (_a2 = getDateState == null ? void 0 : getDateState(date)) != null ? _a2 : defaultGetDateState(date);
11231
+ var _a3;
11232
+ return (_a3 = getDateState == null ? void 0 : getDateState(date)) != null ? _a3 : defaultGetDateState(date);
11214
11233
  },
11215
11234
  [getDateState]
11216
11235
  );
@@ -11238,7 +11257,7 @@ var DatePicker = React66__default.default.forwardRef(
11238
11257
  },
11239
11258
  [isDateDisabled, minDate, maxDate]
11240
11259
  );
11241
- const resolvedMonthLabel = monthLabel != null ? monthLabel : getDefaultMonthLabel(year, month, locale);
11260
+ const resolvedMonthLabel = (_a2 = monthLabel != null ? monthLabel : getMonthLabel == null ? void 0 : getMonthLabel(year, month, locale)) != null ? _a2 : getDefaultMonthLabel(year, month, locale);
11242
11261
  const calendarRows = React66.useMemo(
11243
11262
  () => buildCalendarGrid(year, month),
11244
11263
  [year, month]
@@ -11249,10 +11268,10 @@ var DatePicker = React66__default.default.forwardRef(
11249
11268
  );
11250
11269
  const resolveDateCellConfig = React66.useCallback(
11251
11270
  (date) => {
11252
- var _a2;
11271
+ var _a3;
11253
11272
  const state = resolvedGetDateState(date);
11254
11273
  const isSelectedPrimary = selectedDate != null && dateFns.isSameDay(date, selectedDate);
11255
- const isSelectedSecondary = (_a2 = selectedDatesSet == null ? void 0 : selectedDatesSet.has(toDateKey(date))) != null ? _a2 : false;
11274
+ const isSelectedSecondary = (_a3 = selectedDatesSet == null ? void 0 : selectedDatesSet.has(toDateKey(date))) != null ? _a3 : false;
11256
11275
  const isSelected = isSelectedPrimary || isSelectedSecondary;
11257
11276
  let indicatorBg = "transparent";
11258
11277
  let indicatorBorderColor = "transparent";