@launchdarkly/toolbar 0.13.2-beta.1 → 0.14.0-beta.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.
Files changed (2) hide show
  1. package/dist/js/index.js +37 -11
  2. package/package.json +3 -3
package/dist/js/index.js CHANGED
@@ -3805,6 +3805,9 @@ function OverrideIndicator(props) {
3805
3805
  transition: {
3806
3806
  duration: 0.2
3807
3807
  },
3808
+ "data-testid": "override-indicator",
3809
+ role: onClear ? 'button' : 'status',
3810
+ "aria-label": onClear ? 'Remove flag override' : 'Flag override active',
3808
3811
  children: [
3809
3812
  /*#__PURE__*/ jsx(motion.span, {
3810
3813
  className: overrideDot,
@@ -4135,12 +4138,15 @@ function LocalBooleanFlagControl(props) {
4135
4138
  const { flag, onOverride, disabled = false } = props;
4136
4139
  return /*#__PURE__*/ jsx("div", {
4137
4140
  className: switchContainer,
4141
+ "data-testid": `flag-control-${flag.key}`,
4138
4142
  children: /*#__PURE__*/ jsx(Switch, {
4139
4143
  "data-theme": "dark",
4140
4144
  isSelected: flag.currentValue,
4141
4145
  onChange: onOverride,
4142
4146
  isDisabled: disabled,
4143
- className: switch_
4147
+ className: switch_,
4148
+ "aria-label": `Toggle ${flag.name}`,
4149
+ "data-testid": `flag-switch-${flag.key}`
4144
4150
  })
4145
4151
  });
4146
4152
  }
@@ -4163,8 +4169,9 @@ function LocalStringNumberFlagControl(props) {
4163
4169
  };
4164
4170
  return /*#__PURE__*/ jsx("div", {
4165
4171
  className: customVariantContainer,
4172
+ "data-testid": `flag-control-${flag.key}`,
4166
4173
  children: isEditing ? /*#__PURE__*/ jsx(TextField, {
4167
- "aria-label": `Enter ${flag.type} value`,
4174
+ "aria-label": `Enter ${flag.type} value for ${flag.name}`,
4168
4175
  className: customVariantField,
4169
4176
  "data-theme": "dark",
4170
4177
  children: /*#__PURE__*/ jsxs(Group, {
@@ -4174,17 +4181,20 @@ function LocalStringNumberFlagControl(props) {
4174
4181
  placeholder: `Enter ${flag.type} value`,
4175
4182
  value: tempValue,
4176
4183
  onChange: (e)=>setTempValue(e.target.value),
4177
- type: 'number' === flag.type ? 'number' : 'text'
4184
+ type: 'number' === flag.type ? 'number' : 'text',
4185
+ "data-testid": `flag-input-${flag.key}`
4178
4186
  }),
4179
4187
  /*#__PURE__*/ jsx(IconButton, {
4180
4188
  icon: /*#__PURE__*/ jsx(CheckIcon, {}),
4181
4189
  label: "Confirm",
4182
- onClick: handleConfirm
4190
+ onClick: handleConfirm,
4191
+ "data-testid": `flag-confirm-${flag.key}`
4183
4192
  }),
4184
4193
  /*#__PURE__*/ jsx(IconButton, {
4185
4194
  icon: /*#__PURE__*/ jsx(XIcon, {}),
4186
4195
  label: "Cancel",
4187
- onClick: handleCancel
4196
+ onClick: handleCancel,
4197
+ "data-testid": `flag-cancel-${flag.key}`
4188
4198
  })
4189
4199
  ]
4190
4200
  })
@@ -4193,13 +4203,15 @@ function LocalStringNumberFlagControl(props) {
4193
4203
  children: [
4194
4204
  /*#__PURE__*/ jsx("div", {
4195
4205
  className: currentValueText,
4206
+ "data-testid": `flag-value-${flag.key}`,
4196
4207
  children: String(flag.currentValue)
4197
4208
  }),
4198
4209
  /*#__PURE__*/ jsx(IconButton, {
4199
4210
  icon: /*#__PURE__*/ jsx(EditIcon, {}),
4200
4211
  label: "Edit",
4201
4212
  onClick: ()=>setIsEditing(true),
4202
- disabled: disabled
4213
+ disabled: disabled,
4214
+ "data-testid": `flag-edit-${flag.key}`
4203
4215
  })
4204
4216
  ]
4205
4217
  })
@@ -4234,8 +4246,9 @@ function LocalObjectFlagControl(props) {
4234
4246
  };
4235
4247
  return /*#__PURE__*/ jsx("div", {
4236
4248
  className: customVariantContainer,
4249
+ "data-testid": `flag-control-${flag.key}`,
4237
4250
  children: isEditing ? /*#__PURE__*/ jsx(TextField, {
4238
- "aria-label": "Enter JSON value",
4251
+ "aria-label": `Enter JSON value for ${flag.name}`,
4239
4252
  className: customVariantField,
4240
4253
  "data-theme": "dark",
4241
4254
  children: /*#__PURE__*/ jsxs(Group, {
@@ -4246,7 +4259,9 @@ function LocalObjectFlagControl(props) {
4246
4259
  value: tempValue,
4247
4260
  onChange: (e)=>handleValueChange(e.target.value),
4248
4261
  rows: 4,
4249
- className: parseError ? `${jsonTextarea} ${jsonTextareaError}` : jsonTextarea
4262
+ className: parseError ? `${jsonTextarea} ${jsonTextareaError}` : jsonTextarea,
4263
+ "data-testid": `flag-input-${flag.key}`,
4264
+ "aria-label": `JSON input for ${flag.name}`
4250
4265
  }),
4251
4266
  /*#__PURE__*/ jsxs("div", {
4252
4267
  className: jsonButtonGroup,
@@ -4254,12 +4269,14 @@ function LocalObjectFlagControl(props) {
4254
4269
  /*#__PURE__*/ jsx(IconButton, {
4255
4270
  icon: /*#__PURE__*/ jsx(CheckIcon, {}),
4256
4271
  label: "Confirm",
4257
- onClick: handleConfirm
4272
+ onClick: handleConfirm,
4273
+ "data-testid": `flag-confirm-${flag.key}`
4258
4274
  }),
4259
4275
  /*#__PURE__*/ jsx(IconButton, {
4260
4276
  icon: /*#__PURE__*/ jsx(XIcon, {}),
4261
4277
  label: "Cancel",
4262
- onClick: handleCancel
4278
+ onClick: handleCancel,
4279
+ "data-testid": `flag-cancel-${flag.key}`
4263
4280
  })
4264
4281
  ]
4265
4282
  }),
@@ -4274,13 +4291,15 @@ function LocalObjectFlagControl(props) {
4274
4291
  children: [
4275
4292
  /*#__PURE__*/ jsx("div", {
4276
4293
  className: currentValueText,
4294
+ "data-testid": `flag-value-${flag.key}`,
4277
4295
  children: displayValue
4278
4296
  }),
4279
4297
  /*#__PURE__*/ jsx(IconButton, {
4280
4298
  icon: /*#__PURE__*/ jsx(EditIcon, {}),
4281
4299
  label: "Edit JSON",
4282
4300
  onClick: ()=>setIsEditing(true),
4283
- disabled: disabled
4301
+ disabled: disabled,
4302
+ "data-testid": `flag-edit-${flag.key}`
4284
4303
  })
4285
4304
  ]
4286
4305
  })
@@ -4372,12 +4391,16 @@ function FlagSdkOverrideTabContentInner(props) {
4372
4391
  /*#__PURE__*/ jsx("button", {
4373
4392
  className: `${toggleButton} ${showOverriddenOnly ? active : ''}`,
4374
4393
  onClick: ()=>setShowOverriddenOnly((prev)=>!prev),
4394
+ "data-testid": "show-overrides-only-button",
4395
+ "aria-label": showOverriddenOnly ? 'Show all flags' : 'Show only overridden flags',
4375
4396
  children: "Show overrides only"
4376
4397
  }),
4377
4398
  /*#__PURE__*/ jsxs("button", {
4378
4399
  className: ActionButtonsContainer_css_actionButton,
4379
4400
  onClick: handleClearAllOverrides,
4380
4401
  disabled: 0 === totalOverriddenFlags,
4402
+ "data-testid": "clear-all-overrides-button",
4403
+ "aria-label": `Clear all ${totalOverriddenFlags} flag overrides`,
4381
4404
  children: [
4382
4405
  "Clear all overrides (",
4383
4406
  totalOverriddenFlags,
@@ -4407,6 +4430,7 @@ function FlagSdkOverrideTabContentInner(props) {
4407
4430
  transform: `translateY(${virtualItem.start}px)`,
4408
4431
  borderBottom: '1px solid var(--lp-color-gray-800)'
4409
4432
  },
4433
+ "data-testid": `flag-row-${flagKey}`,
4410
4434
  children: /*#__PURE__*/ jsxs(ListItem, {
4411
4435
  children: [
4412
4436
  /*#__PURE__*/ jsxs("div", {
@@ -4417,6 +4441,7 @@ function FlagSdkOverrideTabContentInner(props) {
4417
4441
  children: [
4418
4442
  /*#__PURE__*/ jsx("span", {
4419
4443
  className: flagNameText,
4444
+ "data-testid": `flag-name-${flagKey}`,
4420
4445
  children: flag.name
4421
4446
  }),
4422
4447
  flag.isOverridden && /*#__PURE__*/ jsx(OverrideIndicator, {
@@ -4426,6 +4451,7 @@ function FlagSdkOverrideTabContentInner(props) {
4426
4451
  }),
4427
4452
  /*#__PURE__*/ jsx("span", {
4428
4453
  className: FlagDevServerTabContent_css_flagKey,
4454
+ "data-testid": `flag-key-${flagKey}`,
4429
4455
  children: flagKey
4430
4456
  })
4431
4457
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchdarkly/toolbar",
3
- "version": "0.13.2-beta.1",
3
+ "version": "0.14.0-beta.1",
4
4
  "description": "A React component that provides a developer-friendly toolbar for interacting with LaunchDarkly during development",
5
5
  "keywords": [
6
6
  "launchdarkly",
@@ -63,6 +63,7 @@
63
63
  "dev:watch": "./scripts/smart-watch-simple.sh",
64
64
  "dev": "rslib build --watch",
65
65
  "format": "prettier --write .",
66
+ "format:ci": "prettier --check .",
66
67
  "lint": "oxlint",
67
68
  "release": "pnpm build && npm publish",
68
69
  "storybook": "storybook dev -p 6006",
@@ -91,7 +92,6 @@
91
92
  "@types/node": "^24.0.4",
92
93
  "@types/react": "^19.1.13",
93
94
  "@vanilla-extract/vite-plugin": "^5.1.1",
94
- "http-server": "^14.1.1",
95
95
  "jsdom": "^26.1.0",
96
96
  "launchdarkly-js-client-sdk": "^3.9.0",
97
97
  "oxlint": "^1.0.0",
@@ -113,7 +113,7 @@
113
113
  "access": "public"
114
114
  },
115
115
  "dependencies": {
116
- "@launchpad-ui/components": "0.16.8",
116
+ "@launchpad-ui/components": "0.16.9",
117
117
  "@launchpad-ui/tokens": "0.15.0",
118
118
  "@react-aria/focus": "3.21.1",
119
119
  "@react-aria/interactions": "3.25.5",