@airtable/blocks 0.0.0-experimental-3e47d4d04-20250909 → 0.0.0-experimental-e625869e5-20251002
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/esm/base/types/airtable_interface.js +1 -3
- package/dist/esm/base/ui/block_wrapper.js +131 -96
- package/dist/esm/base/ui/cell_renderer.js +5 -176
- package/dist/esm/base/ui/global_alert.js +7 -3
- package/dist/esm/base/ui/global_css_helpers.js +28 -0
- package/dist/esm/base/ui/ui.js +1 -21
- package/dist/esm/base/ui/unstable_standalone_ui.js +28 -26
- package/dist/esm/base/ui/use_loadable.js +2 -3
- package/dist/esm/interface/types/airtable_interface.js +2 -3
- package/dist/esm/interface/ui/block_wrapper.js +45 -54
- package/dist/esm/interface/ui/cell_renderer.js +19 -0
- package/dist/esm/interface/ui/global_css_helpers.js +17 -0
- package/dist/esm/interface/ui/ui.js +1 -1
- package/dist/esm/interface/ui/use_custom_properties.js +43 -14
- package/dist/esm/shared/private_utils.js +51 -1
- package/dist/esm/shared/sdk_core.js +1 -1
- package/dist/esm/shared/ui/cell_renderer.js +137 -0
- package/dist/esm/shared/ui/use_watchable.js +2 -3
- package/dist/types/src/base/types/airtable_interface.d.ts +1 -3
- package/dist/types/src/base/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/base/ui/block_wrapper.d.ts +2 -16
- package/dist/types/src/base/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/base/ui/cell_renderer.d.ts +6 -58
- package/dist/types/src/base/ui/cell_renderer.d.ts.map +1 -1
- package/dist/types/src/base/ui/global_css_helpers.d.ts +4 -0
- package/dist/types/src/base/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/base/ui/ui.d.ts +1 -21
- package/dist/types/src/base/ui/ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts +2 -22
- package/dist/types/src/base/ui/unstable_standalone_ui.d.ts.map +1 -1
- package/dist/types/src/base/ui/use_loadable.d.ts.map +1 -1
- package/dist/types/src/interface/types/airtable_interface.d.ts +6 -4
- package/dist/types/src/interface/types/airtable_interface.d.ts.map +1 -1
- package/dist/types/src/interface/ui/block_wrapper.d.ts +1 -4
- package/dist/types/src/interface/ui/block_wrapper.d.ts.map +1 -1
- package/dist/types/src/interface/ui/cell_renderer.d.ts +19 -0
- package/dist/types/src/interface/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts +3 -0
- package/dist/types/src/interface/ui/global_css_helpers.d.ts.map +1 -0
- package/dist/types/src/interface/ui/ui.d.ts +1 -1
- package/dist/types/src/interface/ui/ui.d.ts.map +1 -1
- package/dist/types/src/interface/ui/use_custom_properties.d.ts +7 -0
- package/dist/types/src/interface/ui/use_custom_properties.d.ts.map +1 -1
- package/dist/types/src/shared/private_utils.d.ts +9 -1
- package/dist/types/src/shared/private_utils.d.ts.map +1 -1
- package/dist/types/src/shared/ui/cell_renderer.d.ts +32 -0
- package/dist/types/src/shared/ui/cell_renderer.d.ts.map +1 -0
- package/dist/types/src/shared/ui/use_watchable.d.ts.map +1 -1
- package/package.json +5 -39
- package/dist/esm/base/ui/baymax_utils.js +0 -455
- package/dist/esm/base/ui/box.js +0 -77
- package/dist/esm/base/ui/button.js +0 -143
- package/dist/esm/base/ui/choice_token.js +0 -84
- package/dist/esm/base/ui/collaborator_token.js +0 -115
- package/dist/esm/base/ui/color_palette.js +0 -185
- package/dist/esm/base/ui/color_palette_synced.js +0 -62
- package/dist/esm/base/ui/confirmation_dialog.js +0 -96
- package/dist/esm/base/ui/control_sizes.js +0 -92
- package/dist/esm/base/ui/create_detect_element_resize.js +0 -197
- package/dist/esm/base/ui/css_helpers.js +0 -17
- package/dist/esm/base/ui/dialog.js +0 -93
- package/dist/esm/base/ui/dialog_close_button.js +0 -96
- package/dist/esm/base/ui/field_icon.js +0 -37
- package/dist/esm/base/ui/field_picker.js +0 -91
- package/dist/esm/base/ui/field_picker_synced.js +0 -59
- package/dist/esm/base/ui/form_field.js +0 -102
- package/dist/esm/base/ui/geometry/geometry.js +0 -9
- package/dist/esm/base/ui/geometry/point.js +0 -12
- package/dist/esm/base/ui/geometry/rect.js +0 -44
- package/dist/esm/base/ui/geometry/size.js +0 -12
- package/dist/esm/base/ui/heading.js +0 -125
- package/dist/esm/base/ui/icon.js +0 -102
- package/dist/esm/base/ui/icon_config.js +0 -423
- package/dist/esm/base/ui/input.js +0 -152
- package/dist/esm/base/ui/input_synced.js +0 -59
- package/dist/esm/base/ui/key_codes.js +0 -66
- package/dist/esm/base/ui/label.js +0 -73
- package/dist/esm/base/ui/link.js +0 -189
- package/dist/esm/base/ui/loader.js +0 -52
- package/dist/esm/base/ui/modal.js +0 -135
- package/dist/esm/base/ui/model_picker_select.js +0 -50
- package/dist/esm/base/ui/popover.js +0 -312
- package/dist/esm/base/ui/progress_bar.js +0 -106
- package/dist/esm/base/ui/record_card.js +0 -556
- package/dist/esm/base/ui/record_card_list.js +0 -292
- package/dist/esm/base/ui/select.js +0 -182
- package/dist/esm/base/ui/select_and_select_buttons_helpers.js +0 -53
- package/dist/esm/base/ui/select_buttons.js +0 -150
- package/dist/esm/base/ui/select_buttons_synced.js +0 -55
- package/dist/esm/base/ui/select_synced.js +0 -58
- package/dist/esm/base/ui/switch.js +0 -160
- package/dist/esm/base/ui/switch_synced.js +0 -46
- package/dist/esm/base/ui/synced.js +0 -39
- package/dist/esm/base/ui/system/all_styles_set.js +0 -86
- package/dist/esm/base/ui/system/appearance/appearance_set.js +0 -21
- package/dist/esm/base/ui/system/appearance/background_color.js +0 -12
- package/dist/esm/base/ui/system/appearance/border.js +0 -48
- package/dist/esm/base/ui/system/appearance/border_radius.js +0 -12
- package/dist/esm/base/ui/system/appearance/box_shadow.js +0 -12
- package/dist/esm/base/ui/system/appearance/opacity.js +0 -12
- package/dist/esm/base/ui/system/dimensions/dimensions_set.js +0 -23
- package/dist/esm/base/ui/system/dimensions/height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/max_height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/max_width.js +0 -12
- package/dist/esm/base/ui/system/dimensions/min_height.js +0 -12
- package/dist/esm/base/ui/system/dimensions/min_width.js +0 -12
- package/dist/esm/base/ui/system/dimensions/width.js +0 -12
- package/dist/esm/base/ui/system/display.js +0 -13
- package/dist/esm/base/ui/system/flex_container/align_content.js +0 -9
- package/dist/esm/base/ui/system/flex_container/align_items.js +0 -9
- package/dist/esm/base/ui/system/flex_container/flex_container_set.js +0 -23
- package/dist/esm/base/ui/system/flex_container/flex_direction.js +0 -9
- package/dist/esm/base/ui/system/flex_container/flex_wrap.js +0 -9
- package/dist/esm/base/ui/system/flex_container/justify_content.js +0 -9
- package/dist/esm/base/ui/system/flex_container/justify_items.js +0 -10
- package/dist/esm/base/ui/system/flex_item/align_self.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_basis.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_grow.js +0 -9
- package/dist/esm/base/ui/system/flex_item/flex_item_set.js +0 -25
- package/dist/esm/base/ui/system/flex_item/flex_shrink.js +0 -9
- package/dist/esm/base/ui/system/flex_item/justify_self.js +0 -10
- package/dist/esm/base/ui/system/flex_item/order.js +0 -9
- package/dist/esm/base/ui/system/index.js +0 -96
- package/dist/esm/base/ui/system/overflow.js +0 -15
- package/dist/esm/base/ui/system/position/bottom.js +0 -17
- package/dist/esm/base/ui/system/position/left.js +0 -17
- package/dist/esm/base/ui/system/position/position.js +0 -9
- package/dist/esm/base/ui/system/position/position_set.js +0 -23
- package/dist/esm/base/ui/system/position/right.js +0 -17
- package/dist/esm/base/ui/system/position/top.js +0 -17
- package/dist/esm/base/ui/system/position/z_index.js +0 -12
- package/dist/esm/base/ui/system/spacing/margin.js +0 -65
- package/dist/esm/base/ui/system/spacing/padding.js +0 -58
- package/dist/esm/base/ui/system/spacing/spacing_set.js +0 -15
- package/dist/esm/base/ui/system/typography/font_family.js +0 -12
- package/dist/esm/base/ui/system/typography/font_size.js +0 -12
- package/dist/esm/base/ui/system/typography/font_style.js +0 -9
- package/dist/esm/base/ui/system/typography/font_weight.js +0 -12
- package/dist/esm/base/ui/system/typography/letter_spacing.js +0 -12
- package/dist/esm/base/ui/system/typography/line_height.js +0 -9
- package/dist/esm/base/ui/system/typography/text_align.js +0 -9
- package/dist/esm/base/ui/system/typography/text_color.js +0 -12
- package/dist/esm/base/ui/system/typography/text_decoration.js +0 -9
- package/dist/esm/base/ui/system/typography/text_transform.js +0 -9
- package/dist/esm/base/ui/system/typography/typography_set.js +0 -31
- package/dist/esm/base/ui/system/utils/csstype.js +0 -1
- package/dist/esm/base/ui/system/utils/ensure_numbers_are_within_scale.js +0 -36
- package/dist/esm/base/ui/system/utils/get_style_props_for_responsive_prop.js +0 -67
- package/dist/esm/base/ui/system/utils/types.js +0 -1
- package/dist/esm/base/ui/table_picker.js +0 -64
- package/dist/esm/base/ui/table_picker_synced.js +0 -55
- package/dist/esm/base/ui/text.js +0 -109
- package/dist/esm/base/ui/text_button.js +0 -189
- package/dist/esm/base/ui/theme/default_theme/button_variants.js +0 -53
- package/dist/esm/base/ui/theme/default_theme/control_sizes.js +0 -96
- package/dist/esm/base/ui/theme/default_theme/heading_styles.js +0 -93
- package/dist/esm/base/ui/theme/default_theme/index.js +0 -31
- package/dist/esm/base/ui/theme/default_theme/input_variants.js +0 -32
- package/dist/esm/base/ui/theme/default_theme/link_variants.js +0 -29
- package/dist/esm/base/ui/theme/default_theme/select_buttons_variants.js +0 -66
- package/dist/esm/base/ui/theme/default_theme/select_variants.js +0 -44
- package/dist/esm/base/ui/theme/default_theme/switch_variants.js +0 -78
- package/dist/esm/base/ui/theme/default_theme/text_button_variants.js +0 -38
- package/dist/esm/base/ui/theme/default_theme/text_styles.js +0 -75
- package/dist/esm/base/ui/theme/default_theme/tokens.js +0 -205
- package/dist/esm/base/ui/theme/theme_context.js +0 -7
- package/dist/esm/base/ui/theme/use_theme.js +0 -4
- package/dist/esm/base/ui/tooltip.js +0 -165
- package/dist/esm/base/ui/types/aria_props.js +0 -1
- package/dist/esm/base/ui/types/data_attributes_prop.js +0 -1
- package/dist/esm/base/ui/types/tooltip_anchor_props.js +0 -1
- package/dist/esm/base/ui/use_form_field.js +0 -14
- package/dist/esm/base/ui/use_styled_system.js +0 -19
- package/dist/esm/base/ui/use_text_color_for_background_color.js +0 -9
- package/dist/esm/base/ui/view_picker.js +0 -82
- package/dist/esm/base/ui/view_picker_synced.js +0 -59
- package/dist/esm/base/ui/viewport_constraint.js +0 -120
- package/dist/esm/base/ui/with_styled_system.js +0 -120
- package/dist/types/src/base/ui/baymax_utils.d.ts +0 -2
- package/dist/types/src/base/ui/baymax_utils.d.ts.map +0 -1
- package/dist/types/src/base/ui/box.d.ts +0 -35
- package/dist/types/src/base/ui/box.d.ts.map +0 -1
- package/dist/types/src/base/ui/button.d.ts +0 -86
- package/dist/types/src/base/ui/button.d.ts.map +0 -1
- package/dist/types/src/base/ui/choice_token.d.ts +0 -49
- package/dist/types/src/base/ui/choice_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/collaborator_token.d.ts +0 -45
- package/dist/types/src/base/ui/collaborator_token.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette.d.ts +0 -77
- package/dist/types/src/base/ui/color_palette.d.ts.map +0 -1
- package/dist/types/src/base/ui/color_palette_synced.d.ts +0 -30
- package/dist/types/src/base/ui/color_palette_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/confirmation_dialog.d.ts +0 -66
- package/dist/types/src/base/ui/confirmation_dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/control_sizes.d.ts +0 -16
- package/dist/types/src/base/ui/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/css_helpers.d.ts +0 -6
- package/dist/types/src/base/ui/css_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog.d.ts +0 -58
- package/dist/types/src/base/ui/dialog.d.ts.map +0 -1
- package/dist/types/src/base/ui/dialog_close_button.d.ts +0 -40
- package/dist/types/src/base/ui/dialog_close_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_icon.d.ts +0 -25
- package/dist/types/src/base/ui/field_icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker.d.ts +0 -34
- package/dist/types/src/base/ui/field_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/field_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/field_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/form_field.d.ts +0 -42
- package/dist/types/src/base/ui/form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/geometry.d.ts +0 -3
- package/dist/types/src/base/ui/geometry/geometry.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/point.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/point.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/rect.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/rect.d.ts.map +0 -1
- package/dist/types/src/base/ui/geometry/size.d.ts +0 -2
- package/dist/types/src/base/ui/geometry/size.d.ts.map +0 -1
- package/dist/types/src/base/ui/heading.d.ts +0 -64
- package/dist/types/src/base/ui/heading.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon.d.ts +0 -45
- package/dist/types/src/base/ui/icon.d.ts.map +0 -1
- package/dist/types/src/base/ui/icon_config.d.ts +0 -424
- package/dist/types/src/base/ui/icon_config.d.ts.map +0 -1
- package/dist/types/src/base/ui/input.d.ts +0 -120
- package/dist/types/src/base/ui/input.d.ts.map +0 -1
- package/dist/types/src/base/ui/input_synced.d.ts +0 -18
- package/dist/types/src/base/ui/input_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/key_codes.d.ts +0 -2
- package/dist/types/src/base/ui/key_codes.d.ts.map +0 -1
- package/dist/types/src/base/ui/label.d.ts +0 -35
- package/dist/types/src/base/ui/label.d.ts.map +0 -1
- package/dist/types/src/base/ui/link.d.ts +0 -84
- package/dist/types/src/base/ui/link.d.ts.map +0 -1
- package/dist/types/src/base/ui/loader.d.ts +0 -38
- package/dist/types/src/base/ui/loader.d.ts.map +0 -1
- package/dist/types/src/base/ui/modal.d.ts +0 -54
- package/dist/types/src/base/ui/modal.d.ts.map +0 -1
- package/dist/types/src/base/ui/model_picker_select.d.ts +0 -19
- package/dist/types/src/base/ui/model_picker_select.d.ts.map +0 -1
- package/dist/types/src/base/ui/popover.d.ts +0 -106
- package/dist/types/src/base/ui/popover.d.ts.map +0 -1
- package/dist/types/src/base/ui/progress_bar.d.ts +0 -60
- package/dist/types/src/base/ui/progress_bar.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card.d.ts +0 -80
- package/dist/types/src/base/ui/record_card.d.ts.map +0 -1
- package/dist/types/src/base/ui/record_card_list.d.ts +0 -88
- package/dist/types/src/base/ui/record_card_list.d.ts.map +0 -1
- package/dist/types/src/base/ui/select.d.ts +0 -82
- package/dist/types/src/base/ui/select.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts +0 -25
- package/dist/types/src/base/ui/select_and_select_buttons_helpers.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons.d.ts +0 -56
- package/dist/types/src/base/ui/select_buttons.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_buttons_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_buttons_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/select_synced.d.ts +0 -18
- package/dist/types/src/base/ui/select_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch.d.ts +0 -82
- package/dist/types/src/base/ui/switch.d.ts.map +0 -1
- package/dist/types/src/base/ui/switch_synced.d.ts +0 -18
- package/dist/types/src/base/ui/switch_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/synced.d.ts +0 -23
- package/dist/types/src/base/ui/synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/all_styles_set.d.ts +0 -85
- package/dist/types/src/base/ui/system/all_styles_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts +0 -14
- package/dist/types/src/base/ui/system/appearance/appearance_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border.d.ts +0 -30
- package/dist/types/src/base/ui/system/appearance/border.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/border_radius.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/box_shadow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts +0 -12
- package/dist/types/src/base/ui/system/appearance/opacity.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/dimensions/dimensions_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/max_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/min_width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/dimensions/width.d.ts +0 -12
- package/dist/types/src/base/ui/system/dimensions/width.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/display.d.ts +0 -13
- package/dist/types/src/base/ui/system/display.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/align_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/flex_container/flex_container_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_direction.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/flex_wrap.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_content.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_container/justify_items.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/align_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_basis.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_grow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts +0 -16
- package/dist/types/src/base/ui/system/flex_item/flex_item_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/flex_shrink.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/justify_self.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/flex_item/order.d.ts +0 -12
- package/dist/types/src/base/ui/system/flex_item/order.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/index.d.ts +0 -106
- package/dist/types/src/base/ui/system/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/overflow.d.ts +0 -17
- package/dist/types/src/base/ui/system/overflow.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/bottom.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/bottom.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/left.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/left.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/position.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/position_set.d.ts +0 -15
- package/dist/types/src/base/ui/system/position/position_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/right.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/right.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/top.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/top.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/position/z_index.d.ts +0 -12
- package/dist/types/src/base/ui/system/position/z_index.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/margin.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/margin.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/padding.d.ts +0 -24
- package/dist/types/src/base/ui/system/spacing/padding.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts +0 -11
- package/dist/types/src/base/ui/system/spacing/spacing_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_family.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_family.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_size.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_size.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_style.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_style.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/font_weight.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/letter_spacing.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/line_height.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/line_height.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_align.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_align.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_color.d.ts +0 -16
- package/dist/types/src/base/ui/system/typography/text_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts +0 -14
- package/dist/types/src/base/ui/system/typography/text_decoration.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts +0 -12
- package/dist/types/src/base/ui/system/typography/text_transform.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts +0 -19
- package/dist/types/src/base/ui/system/typography/typography_set.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/csstype.d.ts +0 -3977
- package/dist/types/src/base/ui/system/utils/csstype.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/ensure_numbers_are_within_scale.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts +0 -2
- package/dist/types/src/base/ui/system/utils/get_style_props_for_responsive_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/system/utils/types.d.ts +0 -31
- package/dist/types/src/base/ui/system/utils/types.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker.d.ts +0 -28
- package/dist/types/src/base/ui/table_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/table_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/table_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/text.d.ts +0 -66
- package/dist/types/src/base/ui/text.d.ts.map +0 -1
- package/dist/types/src/base/ui/text_button.d.ts +0 -83
- package/dist/types/src/base/ui/text_button.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts +0 -107
- package/dist/types/src/base/ui/theme/default_theme/control_sizes.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts +0 -11
- package/dist/types/src/base/ui/theme/default_theme/heading_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts +0 -342
- package/dist/types/src/base/ui/theme/default_theme/index.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/input_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/link_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts +0 -8
- package/dist/types/src/base/ui/theme/default_theme/select_buttons_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts +0 -5
- package/dist/types/src/base/ui/theme/default_theme/select_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts +0 -16
- package/dist/types/src/base/ui/theme/default_theme/switch_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts +0 -7
- package/dist/types/src/base/ui/theme/default_theme/text_button_variants.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts +0 -76
- package/dist/types/src/base/ui/theme/default_theme/text_styles.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts +0 -111
- package/dist/types/src/base/ui/theme/default_theme/tokens.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/theme_context.d.ts +0 -342
- package/dist/types/src/base/ui/theme/theme_context.d.ts.map +0 -1
- package/dist/types/src/base/ui/theme/use_theme.d.ts +0 -342
- package/dist/types/src/base/ui/theme/use_theme.d.ts.map +0 -1
- package/dist/types/src/base/ui/tooltip.d.ts +0 -64
- package/dist/types/src/base/ui/tooltip.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/aria_props.d.ts +0 -22
- package/dist/types/src/base/ui/types/aria_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts +0 -10
- package/dist/types/src/base/ui/types/data_attributes_prop.d.ts.map +0 -1
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts +0 -13
- package/dist/types/src/base/ui/types/tooltip_anchor_props.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_form_field.d.ts +0 -2
- package/dist/types/src/base/ui/use_form_field.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/use_styled_system.d.ts.map +0 -1
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts +0 -2
- package/dist/types/src/base/ui/use_text_color_for_background_color.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker.d.ts +0 -34
- package/dist/types/src/base/ui/view_picker.d.ts.map +0 -1
- package/dist/types/src/base/ui/view_picker_synced.d.ts +0 -18
- package/dist/types/src/base/ui/view_picker_synced.d.ts.map +0 -1
- package/dist/types/src/base/ui/viewport_constraint.d.ts +0 -57
- package/dist/types/src/base/ui/viewport_constraint.d.ts.map +0 -1
- package/dist/types/src/base/ui/with_styled_system.d.ts +0 -2
- package/dist/types/src/base/ui/with_styled_system.d.ts.map +0 -1
- package/types/styled-system__core.d.ts +0 -41
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: SelectButtons */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { spawnError } from '../../shared/error_utils';
|
|
5
|
-
import useSynced from '../../shared/ui/use_synced';
|
|
6
|
-
import SelectButtons from './select_buttons';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link SelectButtonsSynced} component. Also accepts:
|
|
10
|
-
* * {@link SelectButtonsStyleProps}
|
|
11
|
-
*
|
|
12
|
-
* @docsPath UI/components/SelectButtonsSynced
|
|
13
|
-
* @groupPath UI/components/SelectButtons
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A wrapper around the {@link SelectButtons} component that syncs with {@link GlobalConfig}.
|
|
18
|
-
*
|
|
19
|
-
* [[ Story id="selectbuttons--synced-example" title="SelectButtonsSynced example" ]]
|
|
20
|
-
*
|
|
21
|
-
* @docsPath UI/components/SelectButtonsSynced
|
|
22
|
-
* @groupPath UI/components/SelectButtons
|
|
23
|
-
* @component
|
|
24
|
-
*/
|
|
25
|
-
const SelectButtonsSynced = (props, ref) => {
|
|
26
|
-
const {
|
|
27
|
-
globalConfigKey,
|
|
28
|
-
onChange,
|
|
29
|
-
disabled,
|
|
30
|
-
...restOfProps
|
|
31
|
-
} = props;
|
|
32
|
-
const [value, setValue, canSetValue] = useSynced(globalConfigKey);
|
|
33
|
-
let selectValue;
|
|
34
|
-
if (value === null || value === undefined) {
|
|
35
|
-
selectValue = null;
|
|
36
|
-
} else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
37
|
-
selectValue = value;
|
|
38
|
-
} else {
|
|
39
|
-
throw spawnError('SelectButtonsSynced only works with a global config value that is a string, number, boolean, null or undefined.');
|
|
40
|
-
}
|
|
41
|
-
return /*#__PURE__*/React.createElement(SelectButtons, _extends({}, restOfProps, {
|
|
42
|
-
ref: ref,
|
|
43
|
-
value: selectValue,
|
|
44
|
-
onChange: newValue => {
|
|
45
|
-
setValue(newValue);
|
|
46
|
-
if (onChange) {
|
|
47
|
-
onChange(newValue);
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
disabled: disabled || !canSetValue
|
|
51
|
-
}));
|
|
52
|
-
};
|
|
53
|
-
const ForwardedRefSelectButtonsSynced = /*#__PURE__*/React.forwardRef(SelectButtonsSynced);
|
|
54
|
-
ForwardedRefSelectButtonsSynced.displayName = 'SelectButtonsSynced';
|
|
55
|
-
export default ForwardedRefSelectButtonsSynced;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: Select */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { spawnError } from '../../shared/error_utils';
|
|
5
|
-
import useSynced from '../../shared/ui/use_synced';
|
|
6
|
-
import Select from './select';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Props for the {@link SelectSynced} component. Also accepts:
|
|
10
|
-
* * {@link SelectStyleProps}
|
|
11
|
-
*
|
|
12
|
-
* @docsPath UI/components/SelectSynced
|
|
13
|
-
* @groupPath UI/components/Select
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* A wrapper around the {@link Select} component that syncs with {@link GlobalConfig}.
|
|
18
|
-
*
|
|
19
|
-
* [[ Story id="select--synced-example" title="Synced select example" ]]
|
|
20
|
-
*
|
|
21
|
-
* @docsPath UI/components/SelectSynced
|
|
22
|
-
* @groupPath UI/components/Select
|
|
23
|
-
* @component
|
|
24
|
-
*/
|
|
25
|
-
const SelectSynced = (props, ref) => {
|
|
26
|
-
const {
|
|
27
|
-
globalConfigKey,
|
|
28
|
-
disabled,
|
|
29
|
-
onChange,
|
|
30
|
-
...restOfProps
|
|
31
|
-
} = props;
|
|
32
|
-
const [value, setValue, canSetValue] = useSynced(globalConfigKey);
|
|
33
|
-
let selectValue;
|
|
34
|
-
if (value === null || value === undefined) {
|
|
35
|
-
selectValue = null;
|
|
36
|
-
} else if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
37
|
-
selectValue = value;
|
|
38
|
-
} else {
|
|
39
|
-
throw spawnError('SelectSynced only works with a global config value that is a string, number, boolean, null or undefined.');
|
|
40
|
-
}
|
|
41
|
-
return /*#__PURE__*/React.createElement(Select, _extends({}, restOfProps, {
|
|
42
|
-
ref: ref,
|
|
43
|
-
value: selectValue,
|
|
44
|
-
onChange: newValue => {
|
|
45
|
-
if (newValue === undefined) {
|
|
46
|
-
newValue = null;
|
|
47
|
-
}
|
|
48
|
-
setValue(newValue);
|
|
49
|
-
if (onChange) {
|
|
50
|
-
onChange(newValue);
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
disabled: disabled || !canSetValue
|
|
54
|
-
}));
|
|
55
|
-
};
|
|
56
|
-
const ForwardedRefSelectSynced = /*#__PURE__*/React.forwardRef(SelectSynced);
|
|
57
|
-
ForwardedRefSelectSynced.displayName = 'SelectSynced';
|
|
58
|
-
export default ForwardedRefSelectSynced;
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui: Switch */ /** */
|
|
2
|
-
import { cx } from 'emotion';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { compose } from '@styled-system/core';
|
|
5
|
-
import { createEnum } from '../../shared/private_utils';
|
|
6
|
-
import useStyledSystem from './use_styled_system';
|
|
7
|
-
import { maxWidth, minWidth, width, flexItemSet, positionSet, spacingSet, display, backgroundColor } from './system';
|
|
8
|
-
import useTheme from './theme/use_theme';
|
|
9
|
-
import { useSwitchSize, ControlSize } from './control_sizes';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Variants for the {@link Switch} component:
|
|
13
|
-
*
|
|
14
|
-
* • **default**
|
|
15
|
-
*
|
|
16
|
-
* Green switch for toggling a setting or other boolean property.
|
|
17
|
-
*
|
|
18
|
-
* • **danger**
|
|
19
|
-
*
|
|
20
|
-
* Red switch for toggling a dangerous or infrequently-used setting.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const SwitchVariant = createEnum('default', 'danger');
|
|
24
|
-
|
|
25
|
-
/** @internal */
|
|
26
|
-
function useSwitchVariant() {
|
|
27
|
-
let variant = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : SwitchVariant.default;
|
|
28
|
-
const {
|
|
29
|
-
switchVariants
|
|
30
|
-
} = useTheme();
|
|
31
|
-
return switchVariants[variant];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* Props shared between the {@link Switch} and {@link SwitchSynced} components.
|
|
36
|
-
*
|
|
37
|
-
* @noInheritDoc
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Props for the {@link Switch} component. Also accepts:
|
|
42
|
-
* * {@link SwitchStyleProps}
|
|
43
|
-
*
|
|
44
|
-
* @docsPath UI/components/Switch
|
|
45
|
-
*/
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Style props for the {@link Switch} component. Also accepts:
|
|
49
|
-
* * {@link BackgroundColorProps}
|
|
50
|
-
* * {@link FlexItemSetProps}
|
|
51
|
-
* * {@link MinWidthProps}
|
|
52
|
-
* * {@link MaxWidthProps}
|
|
53
|
-
* * {@link PositionSetProps}
|
|
54
|
-
* * {@link SpacingSetProps}
|
|
55
|
-
* * {@link WidthProps}
|
|
56
|
-
*
|
|
57
|
-
* @noInheritDoc
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
const styleParser = compose(maxWidth, minWidth, width, flexItemSet, positionSet, spacingSet, display, backgroundColor);
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* A toggle switch for controlling boolean values. Similar to a checkbox.
|
|
64
|
-
*
|
|
65
|
-
* [[ Story id="switch--example" title="Switch example" ]]
|
|
66
|
-
*
|
|
67
|
-
* By default, the Switch component is styled to be full-width (`width="100%"`) with a gray
|
|
68
|
-
* background to match other controls like Select, SelectButtons, Input, etc. This behavior can be
|
|
69
|
-
* overridden using style props. For example, you can set `backgroundColor="transparent"` on the
|
|
70
|
-
* Switch for a transparent background.
|
|
71
|
-
*
|
|
72
|
-
* @docsPath UI/components/Switch
|
|
73
|
-
* @component
|
|
74
|
-
*/
|
|
75
|
-
const Switch = (props, ref) => {
|
|
76
|
-
const {
|
|
77
|
-
disabled,
|
|
78
|
-
id,
|
|
79
|
-
label,
|
|
80
|
-
tabIndex = 0,
|
|
81
|
-
variant = SwitchVariant.default,
|
|
82
|
-
size = ControlSize.default,
|
|
83
|
-
value,
|
|
84
|
-
onClick,
|
|
85
|
-
onChange,
|
|
86
|
-
onMouseEnter,
|
|
87
|
-
onMouseLeave,
|
|
88
|
-
className,
|
|
89
|
-
style,
|
|
90
|
-
'aria-label': ariaLabel,
|
|
91
|
-
'aria-describedby': ariaDescribedBy,
|
|
92
|
-
'aria-labelledby': ariaLabelledBy,
|
|
93
|
-
...styleProps
|
|
94
|
-
} = props;
|
|
95
|
-
const classNameForStyleProps = useStyledSystem({
|
|
96
|
-
display: 'flex',
|
|
97
|
-
width: '100%',
|
|
98
|
-
...styleProps
|
|
99
|
-
}, styleParser);
|
|
100
|
-
const {
|
|
101
|
-
baseClassName: classNameForVariant,
|
|
102
|
-
switchContainerClassName,
|
|
103
|
-
switchClassName,
|
|
104
|
-
switchLabelClassName
|
|
105
|
-
} = useSwitchVariant(variant);
|
|
106
|
-
const classNameForSize = useSwitchSize(size);
|
|
107
|
-
if (!label && !ariaLabelledBy && !ariaLabel) {
|
|
108
|
-
// eslint-disable-next-line no-console
|
|
109
|
-
console.warn('<Switch> should be labeled using either the `label`, `ariaLabel`, or `ariaLabelledBy` prop');
|
|
110
|
-
}
|
|
111
|
-
function _onClick(e) {
|
|
112
|
-
// onClick should only be defined in the case of a tooltip
|
|
113
|
-
if (onClick) {
|
|
114
|
-
onClick(e);
|
|
115
|
-
}
|
|
116
|
-
_toggleValue();
|
|
117
|
-
}
|
|
118
|
-
function _onKeyDown(e) {
|
|
119
|
-
if (e.ctrlKey || e.altKey || e.metaKey) {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (['Enter', ' '].includes(e.key)) {
|
|
123
|
-
e.preventDefault();
|
|
124
|
-
_toggleValue();
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function _toggleValue() {
|
|
128
|
-
if (onChange) {
|
|
129
|
-
onChange(!value);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
-
ref: ref
|
|
134
|
-
// TODO (stephen): remove tooltip anchor props
|
|
135
|
-
,
|
|
136
|
-
onMouseEnter: onMouseEnter,
|
|
137
|
-
onMouseLeave: onMouseLeave,
|
|
138
|
-
onClick: disabled ? undefined : _onClick,
|
|
139
|
-
onKeyDown: disabled ? undefined : _onKeyDown,
|
|
140
|
-
id: id,
|
|
141
|
-
className: cx(classNameForVariant, classNameForSize, classNameForStyleProps, className),
|
|
142
|
-
style: style,
|
|
143
|
-
tabIndex: disabled ? undefined : tabIndex,
|
|
144
|
-
role: "checkbox",
|
|
145
|
-
"aria-disabled": disabled,
|
|
146
|
-
"aria-checked": !!value,
|
|
147
|
-
"aria-label": ariaLabel,
|
|
148
|
-
"aria-labelledby": ariaLabelledBy,
|
|
149
|
-
"aria-describedby": ariaDescribedBy
|
|
150
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
151
|
-
className: switchContainerClassName
|
|
152
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
153
|
-
className: switchClassName
|
|
154
|
-
})), label && /*#__PURE__*/React.createElement("label", {
|
|
155
|
-
className: switchLabelClassName
|
|
156
|
-
}, label));
|
|
157
|
-
};
|
|
158
|
-
const ForwardedRefSwitch = /*#__PURE__*/React.forwardRef(Switch);
|
|
159
|
-
ForwardedRefSwitch.displayName = 'Switch';
|
|
160
|
-
export default ForwardedRefSwitch;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
/** @module @airtable/blocks/ui: Switch */ /** */
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import useSynced from '../../shared/ui/use_synced';
|
|
5
|
-
import Switch from './switch';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Props for the {@link SwitchSynced} component. Also accepts:
|
|
9
|
-
* * {@link SwitchStyleProps}
|
|
10
|
-
*
|
|
11
|
-
* @docsPath UI/components/SwitchSynced
|
|
12
|
-
* @groupPath UI/components/Switch
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A toggleable switch for controlling boolean values, synced with {@link GlobalConfig}. Similar to a checkbox.
|
|
17
|
-
*
|
|
18
|
-
* [[ Story id="switch--example-synced" title="Synced switch example" ]]
|
|
19
|
-
*
|
|
20
|
-
* @docsPath UI/components/SwitchSynced
|
|
21
|
-
* @groupPath UI/components/Switch
|
|
22
|
-
* @component
|
|
23
|
-
*/
|
|
24
|
-
const SwitchSynced = (props, ref) => {
|
|
25
|
-
const {
|
|
26
|
-
disabled,
|
|
27
|
-
globalConfigKey,
|
|
28
|
-
onChange,
|
|
29
|
-
...restOfProps
|
|
30
|
-
} = props;
|
|
31
|
-
const [value, setValue, canSetValue] = useSynced(globalConfigKey);
|
|
32
|
-
return /*#__PURE__*/React.createElement(Switch, _extends({}, restOfProps, {
|
|
33
|
-
ref: ref,
|
|
34
|
-
value: !!value,
|
|
35
|
-
onChange: newValue => {
|
|
36
|
-
setValue(newValue);
|
|
37
|
-
if (onChange) {
|
|
38
|
-
onChange(newValue);
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
disabled: disabled || !canSetValue
|
|
42
|
-
}));
|
|
43
|
-
};
|
|
44
|
-
const ForwardedRefSwitchSynced = /*#__PURE__*/React.forwardRef(SwitchSynced);
|
|
45
|
-
ForwardedRefSwitchSynced.displayName = 'SwitchSynced';
|
|
46
|
-
export default ForwardedRefSwitchSynced;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/** @hidden */ /** */
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
import withHooks from '../../shared/ui/with_hooks';
|
|
4
|
-
import { useSdk } from '../../shared/ui/sdk_context';
|
|
5
|
-
import globalConfigSyncedComponentHelpers from '../../shared/ui/global_config_synced_component_helpers';
|
|
6
|
-
|
|
7
|
-
/** @hidden */
|
|
8
|
-
|
|
9
|
-
/** @hidden */
|
|
10
|
-
export class Synced extends React.Component {
|
|
11
|
-
/** @hidden */
|
|
12
|
-
constructor(props) {
|
|
13
|
-
super(props);
|
|
14
|
-
this._setValue = this._setValue.bind(this);
|
|
15
|
-
}
|
|
16
|
-
/** @internal */
|
|
17
|
-
_setValue(newValue) {
|
|
18
|
-
this.props.sdk.globalConfig.setAsync(this.props.globalConfigKey, newValue);
|
|
19
|
-
}
|
|
20
|
-
/** @hidden */
|
|
21
|
-
render() {
|
|
22
|
-
const {
|
|
23
|
-
globalConfig
|
|
24
|
-
} = this.props.sdk;
|
|
25
|
-
const value = globalConfig.get(this.props.globalConfigKey);
|
|
26
|
-
const canSetValue = globalConfig.hasPermissionToSet(this.props.globalConfigKey);
|
|
27
|
-
return this.props.render({
|
|
28
|
-
value,
|
|
29
|
-
canSetValue,
|
|
30
|
-
setValue: this._setValue
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export default withHooks(Synced, props => {
|
|
35
|
-
globalConfigSyncedComponentHelpers.useDefaultWatchesForSyncedComponent(props.globalConfigKey);
|
|
36
|
-
return {
|
|
37
|
-
sdk: useSdk()
|
|
38
|
-
};
|
|
39
|
-
});
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: All style props */ /** */
|
|
2
|
-
import { compose } from '@styled-system/core';
|
|
3
|
-
import { appearanceSet, dimensionsSet, flexContainerSet, flexItemSet, positionSet, spacingSet, typographySet, display, overflow } from './index';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* In the Blocks SDK, UI components can be styled via a set of supported style props.
|
|
7
|
-
* These style props (e.g. `width`, `margin`, `backgroundColor`) take a subset of
|
|
8
|
-
* supported CSS properties and expose them as explicit React component props.
|
|
9
|
-
*
|
|
10
|
-
* Here is an example that uses the {@link Box} layout primitive:
|
|
11
|
-
*
|
|
12
|
-
* ```
|
|
13
|
-
* <Box
|
|
14
|
-
* display="flex"
|
|
15
|
-
* alignItems="center"
|
|
16
|
-
* justifyContent="center"
|
|
17
|
-
* width="200px"
|
|
18
|
-
* height="200px"
|
|
19
|
-
* >
|
|
20
|
-
* Hello world
|
|
21
|
-
* </Box>
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* This is equivalent to the following:
|
|
25
|
-
*
|
|
26
|
-
* ```
|
|
27
|
-
* <div style={{
|
|
28
|
-
* display: 'flex',
|
|
29
|
-
* alignItems: 'center',
|
|
30
|
-
* justifyContent: 'center',
|
|
31
|
-
* width: '200px',
|
|
32
|
-
* height: '200px',
|
|
33
|
-
* }}>
|
|
34
|
-
* Hello world
|
|
35
|
-
* </div>
|
|
36
|
-
* ```
|
|
37
|
-
*
|
|
38
|
-
* Style props also provide access to Airtable's design tokens, including our color
|
|
39
|
-
* palette, typographic scale, and spacing scale. This allows developers to quickly
|
|
40
|
-
* build UIs that adhere to the Airtable design system. As an example, numbers passed
|
|
41
|
-
* to the `margin` or `padding` props are converted to our spacing scale, based on
|
|
42
|
-
* powers of two.
|
|
43
|
-
*
|
|
44
|
-
* ```
|
|
45
|
-
* <Box margin={0} /> // margin: 0;
|
|
46
|
-
* <Box margin={1} /> // margin: 4px;
|
|
47
|
-
* <Box margin={2} /> // margin: 8px;
|
|
48
|
-
* <Box margin={3} /> // margin: 16px;
|
|
49
|
-
*
|
|
50
|
-
* // Negative margins are also supported
|
|
51
|
-
* <Box margin={-1} /> // margin: -4px;
|
|
52
|
-
* <Box margin={-2} /> // margin: -8px;
|
|
53
|
-
* <Box margin={-3} /> // margin: -16px;
|
|
54
|
-
* ```
|
|
55
|
-
*
|
|
56
|
-
* To override this behavior and use a specific pixel value (or other units, like percentages
|
|
57
|
-
* or ems/rems), you may pass a string like `200px`. However, this is generally discouraged,
|
|
58
|
-
* as these values don't adhere to the same grid/vertical rhythm as the rest of our components.
|
|
59
|
-
*
|
|
60
|
-
* As another example, style props like `backgroundColor` and `textColor` accept
|
|
61
|
-
* {@link Colors|color names} that ensure visual consistency with the Airtable styleguide.
|
|
62
|
-
* Like the spacing scale, you can always opt out by passing in hex/rgb/hsl strings directly.
|
|
63
|
-
*
|
|
64
|
-
* ```
|
|
65
|
-
* <Box backgroundColor="blue" textColor="white" />
|
|
66
|
-
* ```
|
|
67
|
-
*
|
|
68
|
-
* Each component in our UI library exposes a particular subset of style props, documented as
|
|
69
|
-
* style prop interfaces. For more information, refer to the API reference for the specific
|
|
70
|
-
* component that you're trying to use.
|
|
71
|
-
*
|
|
72
|
-
* All supported style props:
|
|
73
|
-
* * {@link AppearanceSetProps|Appearance}
|
|
74
|
-
* * {@link DimensionsSetProps|Dimensions}
|
|
75
|
-
* * {@link FlexContainerSetProps|Flex container}
|
|
76
|
-
* * {@link FlexItemSetProps|Flex item}
|
|
77
|
-
* * {@link PositionSetProps|Position}
|
|
78
|
-
* * {@link SpacingSetProps|Spacing}
|
|
79
|
-
* * {@link TypographySetProps|Typography}
|
|
80
|
-
* * {@link DisplayProps|Display}
|
|
81
|
-
* * {@link OverflowProps|Overflow}
|
|
82
|
-
*
|
|
83
|
-
* @docsPath UI/Style System/All styles
|
|
84
|
-
*/
|
|
85
|
-
|
|
86
|
-
export const allStylesParser = compose(appearanceSet, dimensionsSet, flexContainerSet, flexItemSet, positionSet, spacingSet, typographySet, display, overflow);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
import { config as backgroundColorConfig } from './background_color';
|
|
4
|
-
import { config as borderConfig } from './border';
|
|
5
|
-
import { config as borderRadiusConfig } from './border_radius';
|
|
6
|
-
import { config as boxShadowConfig } from './box_shadow';
|
|
7
|
-
import { config as opacityConfig } from './opacity';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Style props for the visual appearance of an element.
|
|
11
|
-
*
|
|
12
|
-
* @docsPath UI/Style System/Appearance
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const appearanceSet = system({
|
|
16
|
-
...backgroundColorConfig,
|
|
17
|
-
...borderRadiusConfig,
|
|
18
|
-
...borderConfig,
|
|
19
|
-
...boxShadowConfig,
|
|
20
|
-
...opacityConfig
|
|
21
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
backgroundColor: {
|
|
8
|
-
property: 'backgroundColor',
|
|
9
|
-
scale: 'colors'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const backgroundColor = system(config);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
border: {
|
|
8
|
-
property: 'border',
|
|
9
|
-
scale: 'borders'
|
|
10
|
-
},
|
|
11
|
-
borderWidth: {
|
|
12
|
-
property: 'borderWidth',
|
|
13
|
-
scale: 'borderWidths'
|
|
14
|
-
},
|
|
15
|
-
borderStyle: {
|
|
16
|
-
property: 'borderStyle',
|
|
17
|
-
scale: 'borderStyles'
|
|
18
|
-
},
|
|
19
|
-
borderColor: {
|
|
20
|
-
property: 'borderColor',
|
|
21
|
-
scale: 'colors'
|
|
22
|
-
},
|
|
23
|
-
borderTop: {
|
|
24
|
-
property: 'borderTop',
|
|
25
|
-
scale: 'borders'
|
|
26
|
-
},
|
|
27
|
-
borderRight: {
|
|
28
|
-
property: 'borderRight',
|
|
29
|
-
scale: 'borders'
|
|
30
|
-
},
|
|
31
|
-
borderBottom: {
|
|
32
|
-
property: 'borderBottom',
|
|
33
|
-
scale: 'borders'
|
|
34
|
-
},
|
|
35
|
-
borderLeft: {
|
|
36
|
-
property: 'borderLeft',
|
|
37
|
-
scale: 'borders'
|
|
38
|
-
},
|
|
39
|
-
borderX: {
|
|
40
|
-
properties: ['borderLeft', 'borderRight'],
|
|
41
|
-
scale: 'borders'
|
|
42
|
-
},
|
|
43
|
-
borderY: {
|
|
44
|
-
properties: ['borderTop', 'borderBottom'],
|
|
45
|
-
scale: 'borders'
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
export const border = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
borderRadius: {
|
|
8
|
-
property: 'borderRadius',
|
|
9
|
-
scale: 'radii'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const borderRadius = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
boxShadow: {
|
|
8
|
-
property: 'boxShadow',
|
|
9
|
-
scale: 'shadows'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const boxShadow = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Appearance */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
opacity: {
|
|
8
|
-
property: 'opacity',
|
|
9
|
-
scale: 'opacities'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const opacity = system(config);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Dimensions */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
import { config as heightConfig } from './height';
|
|
4
|
-
import { config as maxHeightConfig } from './max_height';
|
|
5
|
-
import { config as maxWidthConfig } from './max_width';
|
|
6
|
-
import { config as minHeightConfig } from './min_height';
|
|
7
|
-
import { config as minWidthConfig } from './min_width';
|
|
8
|
-
import { config as widthConfig } from './width';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Style props for the dimensions of an element.
|
|
12
|
-
*
|
|
13
|
-
* @docsPath UI/Style System/Dimensions
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export const dimensionsSet = system({
|
|
17
|
-
...heightConfig,
|
|
18
|
-
...maxWidthConfig,
|
|
19
|
-
...maxHeightConfig,
|
|
20
|
-
...minHeightConfig,
|
|
21
|
-
...minWidthConfig,
|
|
22
|
-
...widthConfig
|
|
23
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Dimensions */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
maxHeight: {
|
|
8
|
-
property: 'maxHeight',
|
|
9
|
-
scale: 'dimensions'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const maxHeight = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Dimensions */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
maxWidth: {
|
|
8
|
-
property: 'maxWidth',
|
|
9
|
-
scale: 'dimensions'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const maxWidth = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Dimensions */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
minHeight: {
|
|
8
|
-
property: 'minHeight',
|
|
9
|
-
scale: 'dimensions'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const minHeight = system(config);
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** @module @airtable/blocks/ui/system: Dimensions */ /** */
|
|
2
|
-
import { system } from '@styled-system/core';
|
|
3
|
-
|
|
4
|
-
/** */
|
|
5
|
-
|
|
6
|
-
export const config = {
|
|
7
|
-
minWidth: {
|
|
8
|
-
property: 'minWidth',
|
|
9
|
-
scale: 'dimensions'
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export const minWidth = system(config);
|